SQLite User Forum

Assertion failure in recoverAddTable function
Login

Assertion failure in recoverAddTable function

(1) By Song Liu (songliu) on 2023-04-20 04:06:32 [source]

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

CREATE TABLE t(a, PRIMARY KEY(a, a COLLATE NOCASE)) WITHOUT ROWID;
.r

Here are the outputs:

BEGIN;
PRAGMA writable_schema = on;
PRAGMA encoding = 'UTF-8';
PRAGMA page_size = '4096';
PRAGMA auto_vacuum = '0';
PRAGMA user_version = '0';
PRAGMA application_id = '0';
CREATE TABLE t(a, PRIMARY KEY(a, a COLLATE NOCASE)) WITHOUT ROWID;
sqlite3: shell.c:14742: void recoverAddTable(sqlite3_recover *, const char *, i64): Assertion `iField<pNew->nCol && iCol<pNew->nCol' failed.
[1]    2061318 abort      ./sqlite3 < poc

Here is the result of bisecting:

 13 BAD     2022-10-26 18:41:12 a820792548da596e CURRENT
 12 GOOD    2022-10-26 18:04:34 4eef562a00ae988f

My compilation flags:

export CFLAGS="-g -DSQLITE_DEBUG" 

(2) By Larry Brasfield (larrybr) on 2023-04-20 16:42:56 in reply to 1 [link] [source]

Thanks. Fixed by Dan this morning.

(3) By Song Liu (songliu) on 2023-04-20 18:44:54 in reply to 2 [link] [source]

Thank you Dan! Thank you Larry!