SQLite Forum

SQLite assertion failure
Login

SQLite assertion failure

(1) By Yu Liang (LY1598773890) on 2022-03-02 19:59:11 [source]

Query:

CREATE TABLE v0 ( c1 INT ); 
CREATE INDEX i2 ON v0 ( ( c1 BETWEEN 0 AND 10 ), c1 ); 
CREATE VIEW v3 AS SELECT * FROM v0 AS a4 NATURAL JOIN v0 AS a5 WHERE ( c1 BETWEEN 0 AND 10 ) OR ( TRUE ); 
INSERT INTO v0 VALUES ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 ), ( 0 );  -- Insert multiple 0s, here we insert 20 of 0s. 
CREATE VIEW v24 AS SELECT * FROM v3 AS a25 NATURAL JOIN v3 AS a26; 
CREATE VIEW v29 AS SELECT c1, c1 FROM v24, v3 USING ( c1 ) GROUP BY c1; 
ANALYZE;  
SELECT c1 FROM v29; 

Run on Debug Version

sqlite3: sqlite3.c:93352: int sqlite3VdbeExec(Vdbe *): Assertion `pOp->p2>0 && pOp->p2<p->nOp' failed.
[1]    311527 abort (core dumped)  ./sqlite3

Run on Non-Debug Version:

Returns 0 after a long wait time due to the multiple joins.

Bisect:

  1 BAD     2022-03-02 17:50:59 86c5fa2f301e4bdb
  5 BAD     2022-01-12 20:31:14 9282bcde301cee2a
  7 BAD     2021-12-29 13:32:36 d4870c08893ea998
  8 BAD     2021-12-16 14:59:25 d156123885abe6bf
  9 BAD     2021-12-13 19:59:55 cdcde00b2d68eeb3
 10 BAD     2021-12-10 21:01:24 8e98ba1eeb1a5a61
 11 BAD     2021-12-09 20:06:18 633bfeeea2bccdd4
 12 GOOD    2021-12-09 16:26:45 1eefd957ff35e961 CURRENT
  6 GOOD    2021-12-09 14:09:47 94fdbeffaf501daf
  4 GOOD    2021-11-06 10:59:27 a024764cef955099
  3 GOOD    2021-07-09 00:12:05 eb8af9a494fb68c0
  2 GOOD    2020-12-01 16:14:00 a26b6597e3ae2722

20:06:18 [633bfeeea2] *MERGE* Add support for Bloom-filters as a performance optimization for joins. (user: drh tags: trunk)

Looking forward to replies. :-)

(2) By Yu Liang (LY1598773890) on 2022-03-05 19:16:34 in reply to 1 [link] [source]

Hi all. :-)

Just checking whether there are any updates on the reported Assertion Failure?

Really appreciate with the efforts that the maintainers put in to confirm and fix the potential problems we reported. Thank you all.

(3) By Richard Hipp (drh) on 2022-03-05 21:06:11 in reply to 2 [link] [source]

Fixed by check-in ad3ffa1a75a5a032. I just neglected to update this forum thread.

The change is on trunk and on branch-3.38 and is included in the latest snapshot tarball on the download page.