SQLite Forum

Assertion failure in sqlite3VdbePreUpdateHook function
Login

Assertion failure in sqlite3VdbePreUpdateHook function

(1) By Song Liu (songliu) on 2023-04-22 04:47:41 [source]

I found an assertion failure while SQLite (latest, 7809e7ce6a70657b) executes the following queries.

.session open 0 0
CREATE TEMP TABLE t0 (c AS (NULL) UNIQUE, c0 PRIMARY KEY);
INSERT INTO t0 (c0) VALUES (0);

Here are the outputs:

sqlite3: sqlite3.c:88090: void sqlite3VdbePreUpdateHook(Vdbe *, VdbeCursor *, int, const char *, Table *, i64, int, int): Assertion `pCsr->nField==pTab->nCol || (pCsr->nField==pTab->nCol+1 && op==SQLITE_DELETE && iReg==-1)' failed.

My compilation flags:

export CFLAGS="-g -DSQLITE_DEBUG
            -DSQLITE_ENABLE_TREETRACE
            -DSQLITE_ENABLE_WHERETRACE
            -DSQLITE_ENABLE_CURSOR_HINTS
            -DSQLITE_COUNTOFVIEW_OPTIMIZATION
            -DSQLITE_ENABLE_STAT4"
./configure --enable-all --enable-debug --disable-shared && make