fix preUpdateHookTrampoline signature

iKey2 is an int64, not two int32s.

The trampoline's parameter list appears to have been modeled after the internal SQLite function sqlite3VdbePreUpdateHook, which takes (i64 iKey1, int iReg, int iBlobWrite).

But that internal function computes iKey2 from iReg before invoking the public callback, whose actual signature ends with (sqlite3_int64 iKey1, sqlite3_int64 iKey2).

The trampoline declared the final slot as (iReg int32, iBlobWrite int32) instead of (iKey2 int64), which works except for large rowids. Depending on the arch, this likely manifests as truncation.

It's rather unclear how important this is, but on the other hand, the fix is small and targeted and highly testable, and for e.g. snowflake-style IDs, it'd show up as silent corruption.

Merge request reports

Loading