A testcase causing Assertion `(*ppPage)->pgno==pgno' failed
(1) By Jingzhou Fu (fuboat) on 2022-02-28 16:38:25 [source]
System Information:
compile-time options: CC=clang-12 ./configure --enable-debug
sqlite_source_id: 2022-02-28 13:38:28 f2f0426035d4e0334be000a3eb62bbd7d61fdab7c2ef9ba13cfdf6482396dd13
output: sqlite_driver: sqlite3.c:68456: int getAndInitPage(BtShared *, Pgno, MemPage **, BtCursor *, int): Assertion `(*ppPage)->pgno==pgno' failed.
PoC (I've already tried my best to trim it, but it is still a little large. 67 lines. I am very confused by this testcase...) :
CREATE TABLE v1 (
sqlsim9,
v1 sqlsim9 UNIQUE AS (1),
sqlite_sequence,
b REFERENCES v1(v1)
);
CREATE TABLE name (
seq,
name seq UNIQUE AS (1),
x_sequence,
c REFERENCES name(name)
);
CREATE INDEX t0 ON v1(b) WHERE b IS NOT NULL;
CREATE INDEX c0 ON v1(b) WHERE b>10;
CREATE INDEX t2 ON name(c) WHERE c>10;
CREATE VIRTUAL TABLE nums USING wholenumber;
PRAGMA.integrity_check;
CREATE TABLE t4(a INTEGER PRIMARY KEY,b);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<1000)
INSERT INTO t4(a,b) SELECT x, julianday('2017-07-01')+x FROM c;
DELETE FROM t4 WHERE a=500;
CREATE INDEX t4b1 ON t4(b)
WHERE date(b) BETWEEN '2017-06-01' AND '2017-08-31';
INSERT INTO t4(a,b) VALUES(9999,'now');
CREATE TABLE mods(x);
CREATE TABLE t5(y,m);
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<5)
INSERT INTO t5(y,m) SELECT julianday('2017-07-01')%c.x, mods.x FROM c, mods;
CREATE INDEX t5x1 on t5(y) WHERE datetime(y,m) IS NOT NULL;
PRAGMA auto_vacuum = incremental;
PRAGMA max_page_count = 2;
PRAGMA journal_mode = off;
VACUUM;
VACUUM;
DROP table "v1";
PRAGMA foreign_keys = 0;
DROP table "t1";
DROP TABLE t4;
PRAGMA foreign_keys = 0;
CREATE TABLE t1(a, b, c);
CREATE TABLE t2(d, e, f);
CREATE TABLE t3(g BIGINT, h VARCHAR(10));
CREATE TABLE t4(i BLOB, j ANYOLDATA);
CREATE TABLE t5(k FLOAT, l INTEGER);
CREATE TABLE t6(m DEFAULT 10, n DEFAULT 5, PRIMARY KEY(m, n));
CREATE TABLE t7(x INTEGER PRIMARY KEY);
DROP table "t3";
DROP table "t4";
DROP table "t5";
DROP table "t6";
DROP table "t7";
DROP table "t8";
DROP table "t9";
DROP table "x1";
CREATE TABLE sqlit_abc(a, b, c);
CREATE TABLE t1(a, b, c);
CREATE TABLE t2(d, e, f);
CREATE TABLE t3(g BIGINT, h VARCHAR(10));
CREATE TABLE t4(i BLOB, j ANYOLDATA);
CREATE TABLE t5(k FLOAT, l INTEGER);
CREATE TABLE t6(m DEFAULT 10, n DEFAULT 5, PRIMARY KEY(m, n));
CREATE TABLE t7(x INTEGER PRIMARY KEY);
CREATE TABLE t8(o COLLATE nocase DEFAULT 'abc');
CREATE TABLE t9(p NOT NULL, q DOUBLE CHECK (q!=0), r STRING UNIQUE);
DROP table "t5";
DROP table "t6";
DROP table "t8";
(2) By Richard Hipp (drh) on 2022-03-01 16:24:29 in reply to 1 [link] [source]
Fixed on trunk. Just needed to add the term "|| CORRUPT_DB
" to a couple of
assert() statements. No changes to deliverable code. Test cases added to
TH3.