SQLite User Forum

Assertion failure in sqlite3VdbeExec function (ALWAYS macro)
Login

Assertion failure in sqlite3VdbeExec function (ALWAYS macro)

(1) By Song Liu (songliu) on 2023-04-27 23:28:09 [source]

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

CREATE TABLE v0 (c1);
CREATE VIEW v1 AS SELECT c1 COLLATE NOCASE FROM (SELECT c1, max(0) FROM v0);
SELECT a0.c1 FROM v0 AS a0 LEFT JOIN v1 AS a1 ON a0.c1 LEFT JOIN v1 AS a2 ON a1.c1 WHERE a2.c1;

Here are the outputs:

sqlite3-asan: sqlite3.c:93400: sqlite3VdbeExec: Assertion `0' failed.
[1]    3131058 IOT instruction  ./sqlite3-asan < poc

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

(2) By Larry Brasfield (larrybr) on 2023-04-28 00:46:03 in reply to 1 [link] [source]

This was recently fixed.

(3) By Song Liu (songliu) on 2023-04-28 00:57:51 in reply to 2 [link] [source]

Thanks for your efforts!