Skip to content

Instantly share code, notes, and snippets.

@penberg
Created October 8, 2026 09:11
Show Gist options
  • Select an option

  • Save penberg/e7fb76d033c0bec32865ed2f4824bc5c to your computer and use it in GitHub Desktop.

Select an option

Save penberg/e7fb76d033c0bec32865ed2f4824bc5c to your computer and use it in GitHub Desktop.
Turso upstream SQLite TCL conformance run (all.test) — 2026-10-08

Turso upstream SQLite TCL conformance run (all.test) — 2026-10-08

Results of running Turso's upstream SQLite TCL conformance suite (sqlite/conformance/upstream/all.test) on October 8, 2026, on main at 8cc059bd9 ("Merge 'core/mvcc: keep the index map of a rolled-back CREATE INDEX alive for open cursors' from Jussi Saurio"). TCL bindings rebuilt from the same commit against a release build of turso_sqlite3, tclsh 9.0.2. Run from an empty directory. Wall-clock: 11.4 minutes.

Summary

  • 330,037 / 339,846 tests passed (97.1%)
  • 221 files fully passing (blessed)
  • 490 known-bad files that ran to their summary (XFAIL)
  • 87 files that stopped on an error outside of a test (XABORT; their tests up to the stop are counted)
  • 10 files that crashed on an engine panic (XCRASH) and 5 that hit the timeout (XHANG); both contained, tests before the death counted
  • 22 files that ran zero tests (EMPTY), every one of them because the file disables itself
  • 10 skipped files: the three meta-runners and the seven fuzz files
  • Run exited clean: no blessed file regressed, no known-bad file went fully green

Compared to the 2026-09-30 report at 33c1036a3 (326,569 / 339,246, 96.3%):

  • +3,467 more tests passing, 598 more tests executing. Most of it is the RIGHT and FULL JOIN work: joinD goes from 926 failures to 2, and joinB, joinC, join9, joinA and joinF pass completely.
  • 12 files blessed: e_select2, join9, joinA, joinB, joinC, joinF, tkt-7a31705a7e6, tkt-99378177930f87bd, tkt-d82e3f3721, tkt1537, tkt3911, upfrom4. 209 blessed files became 221.
  • Five of the six outer-join wrong results from the last two reports are fixed: joinD-75/-76 and join8-18010/-18020/-19010 now pass. where-20.0 (expression index under a LEFT JOIN) still returns the wrong count.
  • Two new wrong results, both from one commit (fc3222017): an indexed expression nested inside a larger expression is now read from the index, which loses the JSON subtype in one case and the COLLATE in another. Confirmed by building the commit and its parent (see below).
  • Six fewer aborts: five files no longer stop on PRAGMA auto_vacuum=OFF, and e_select2 no longer stops on a parenthesized FROM clause.
  • No new crashes. misc2 (whole-table DELETE under an open SELECT) still panics.

For a test-by-test comparison, the suite was also run again at 33c1036a3 on the same machine, also from an empty directory. That run gave 326,570 / 339,248, within two tests of the last report. Matching each test by name and position in the two sets of logs: 2,904 tests now pass that failed before, and 14 tests now fail that passed before. All 14 are explained below.

What changed between the two runs

133 non-merge commits. The ones that show up in the TCL suite:

  • RIGHT and FULL JOIN (44fe44520 implement SQLite-style right and full joins, ec37ceb07 reduce outer joins in SQLite order, 39061f62f plan unmatched right rows with separate reads, 54c51d19e/13854a23a merged USING columns, dbecb0535/19c92eeb2 parenthesized full joins). The 910 RIGHT JOIN following another join is not yet supported errors and the 257 FULL JOIN errors from the last report are gone. joinD 926 → 2 failures, joinB 476 → 0, join9 120 → 0, joinA 33 → 0, joinF 30 → 0, join7 217 → 63, join8 44 → 5, joinH 31 → 3.
  • Parenthesized FROM clauses (3d4cceba1 lower parenthesized join groups like SQLite, and the six commits after it). The 434 Parenthesized FROM clause subqueries are not supported errors are gone. joinC 256 → 0; e_select2 runs past line 335 and is blessed (46 → 205 tests).
  • Expression indexes under outer joins (78361bbb5 recompute expression-index values for outer null rows, d368eb546 IfNullRow, c6de95c26, 97fe040a0). These fix the join8-18010/-18020/-19010 wrong results.
  • core: find indexed expressions inside aggregate inputs (fc3222017). Fixes tkt-99378177930f87bd (blessed) and indexexpr1-130eqp/-141eqp/-150eqp, indexexpr3-1.3/-1.4. Also introduces the two wrong results below.
  • core: treat unknown PRAGMA auto_vacuum values as NONE (0915fc726). PRAGMA auto_vacuum=OFF used to fail with invalid auto vacuum mode in 18 files. wal3 goes from 247 failures to 2; date, nan, pageropt, vacuum3 and walprotocol no longer abort. lock4 now gets further and then waits for a test2.db-journal file that WAL mode never creates, so the same commit marks it hang.
  • bindings/tcl: register the csv module for the upstream csv01 test (8f043dd28). csv01 467 → 14 failures.
  • core: implement PRAGMA wal_autocheckpoint (d195edd38). Fixes nockpt (15 → 6), walhook (10 → 6) and wal7-3.0, and causes three new failures (below).

New wrong results: indexed expressions read from the index inside larger expressions

fc3222017 made the planner look for indexed expressions inside every part of an expression, not only at the top of each SELECT expression. When it finds one, the value is read from the index instead of computed. That is correct only when the stored value means the same thing as a fresh one. Two cases where it does not:

JSON subtype lost (indexexpr1-2211, -2221, -2231, -2241, -2251, -2261, -2300):

CREATE TABLE t1(x INT, y TEXT);
INSERT INTO t1 VALUES(1, '{b:5}');
CREATE INDEX t1j ON t1(coalesce(null, json(y)));
SELECT json_insert('{}', '$.a', coalesce(null, json(y)))->>'$.a.b' FROM t1;
-- SQLite: 5     Turso: NULL

The plan changes from SCAN t1 to SCAN t1 USING COVERING INDEX t1j, and the json() call disappears from the bytecode. The value read from the index is plain text without the JSON subtype, so json_insert stores it as a string and ->>'$.a.b' finds nothing. Without the index Turso returns 5. SQLite never uses an index this way for a function that returns a subtype (indexexpr1-2300 tests exactly that). indexexpr3-1.5/-1.6 are the same change: the results are still right there, but the test checks that json_extract is computed again (2 Function opcodes, Turso now has 1).

COLLATE lost (indexexpr1-1910, -1920):

CREATE TABLE t1(x TEXT PRIMARY KEY, y TEXT, z INT);
INSERT INTO t1 VALUES('alpha','ALPHA',1),('bravo','charlie',1);
CREATE INDEX i1 ON t1(+y COLLATE NOCASE);
DELETE FROM t1 INDEXED BY i1
 WHERE x IS +y COLLATE NOCASE IN (SELECT z FROM t1) RETURNING *;
-- SQLite: deletes and returns 'alpha ALPHA 1'     Turso: deletes nothing

+y COLLATE NOCASE is now read from i1, and the comparison changes from Eq ... NoCase to Eq ... Binary, so 'alpha' IS 'ALPHA' is false.

Both reproduce with a short TCL script against libturso_tcl.so outside the harness. Built at fc3222017^, both return SQLite's answer; built at fc3222017, both return the wrong one. The same commit also fixes a different wrong answer: the plain SELECT x FROM t1 WHERE x IS +y COLLATE NOCASE IN (SELECT z FROM t1) returned no rows before it and correctly returns alpha after it.

Other new failures: PRAGMA wal_autocheckpoint

Before d195edd38, Turso ignored wal_autocheckpoint as an unknown pragma. Two differences from SQLite now show:

  • PRAGMA wal_autocheckpoint=OFF fails with signed-number must follow the format: ([+|-] numeric-literal). SQLite accepts it and sets the value to 0. Breaks walpersist-2.1.
  • After an automatic checkpoint, Turso shrinks the WAL file; SQLite leaves it at its size unless journal_size_limit says otherwise. With wal_autocheckpoint=50 and a 200 KB insert, SQLite's WAL is 213,824 bytes and Turso's 6,320 (checked against Python's sqlite3). wal7-1.0/-1.1, which expect a large WAL, now fail, and wal7-3.0, which sets journal_size_limit=0, now passes. The shrinking itself is not new; it shows now because the 50-page threshold is used.

Files that moved

File 2026-09-30 2026-10-08 Why
joinD 1,170 / 926 1,170 / 2 RIGHT/FULL JOIN; the 2 left are an INSTEAD OF trigger and its cascade
joinB 512 / 476 512 / 0, blessed RIGHT/FULL JOIN
csv01 467 / 467 467 / 14 csv module registered (8f043dd28)
date 1,333 / 44, abort 1,677 / 43 auto_vacuum=OFF (0915fc726); now runs past line 520
joinC 256 / 256 256 / 0, blessed parenthesized FROM
wal3 345 / 247, abort 345 / 2, abort auto_vacuum=OFF; still stops at line 123 (second process cannot open the database)
e_select2 46 / 1, abort 205 / 0, blessed parenthesized FROM
join7 300 / 217 300 / 63 FULL JOIN; 58 of the 63 are views with a column list over VALUES (below)
join9 150 / 120 150 / 0, blessed RIGHT/FULL JOIN
vacuum3 37 / 29, abort 93 / 26 auto_vacuum=OFF
join8 105 / 44 105 / 5 outer joins; 18010/18020/19010 wrong results fixed
joinA, joinF 42 / 33, 54 / 30 42 / 0, 54 / 0, blessed RIGHT/FULL JOIN
nan 16 / 16, abort 47 / 17 auto_vacuum=OFF
joinH 67 / 31 67 / 3 outer joins
selectD 31 / 29 31 / 5 parenthesized FROM
join 186 / 27 186 / 17 outer joins
nockpt, walhook 23 / 15, 14 / 10 23 / 6, 14 / 6 wal_autocheckpoint
walprotocol, pageropt 13 / 11, 4 / 4, both abort 14 / 6, 15 / 12 auto_vacuum=OFF
tkt-99378177930f87bd, tkt-7a31705a7e6, tkt-d82e3f3721, tkt1537, tkt3911, upfrom4 failing blessed join and expression-index work
lock4 4 / 4 2 / 2, timeout gets past auto_vacuum=OFF, then waits for a rollback journal; now marked hang
indexexpr1 106 / 31 106 / 36 regression: 9 new failures, 4 fixed (fc3222017, above)
indexexpr3 13 / 7 13 / 7 2 new failures, 2 fixed (fc3222017, above)
wal7 6 / 4 6 / 5 2 new failures, 1 fixed (d195edd38, above)
walpersist 20 / 12 20 / 13 wal_autocheckpoint=OFF rejected (above)
trans2 38 / 22 36 / 21 how far the stress loop gets in 30 s

23 more files gain 1 to 6 passing tests each, mostly from the join, expression-index and auto_vacuum changes.

Where the 87 aborts come from

Same files, lines and messages as last time, minus date, nan, pageropt, vacuum3, walprotocol and e_select2.

Files Cause
34 Cascade: an earlier failed statement left a table or handle missing (no such table, invalid command name "db2", can't read "STMT"), so a later top-level cleanup fails
19 unable to open database file: 14 multi-connection tests whose second process cannot open the database, 4 files that damage the header on purpose, and misc7, which opens a database in a read-only directory
7 WITHOUT ROWID: CREATE INDEX (3), secondary UNIQUE (3), DELETE (1)
6 Test-only SQL functions or modules: tointeger, counter2, echo, transitive_closure, wholenumber, sqlite_compileoption_used
5 Engine SQL gaps at file top level: MATCH, stored generated columns, PRAGMA encoding=UTF-16 (two files), INSTEAD OF triggers
4 Harness stubs that cannot emulate the real thing: vfs_shmlock, add_test_collate, sqlite3_busy_timeout, test_override_sum
3 pragma_compile_options / sqlite_stat4 tables missing
3 Incremental auto-vacuum not supported
3 No -shm file (Turso keeps the WAL index in memory)
1 e_fkey: DELETE on a child table reports foreign key mismatch where the parent key is a multi-column UNIQUE index
1 select9: a collation registered with db collate is not found when used in an index definition
1 snapshot: database table is locked

Crashes and hangs

The same ten files die on an engine panic, at the same test counts. Only line numbers moved.

File Tests before Panic
corrupt4, corruptJ 7, 2 about to push page twice (core/storage/btree.rs:8740)
corrupt9 4 Freelist leaf page has overflow cells (core/storage/pager.rs:5946)
corruptI 5 slice index out of range (core/types.rs:3140)
rollback2, misc2 48, 31 self.current_page >= 0 (core/storage/btree.rs:8853)
altertab, tabfunc01 92, 70 Could not find virtual table for VRollback (core/vdbe/execute.rs:1888)
altertab3 94 table_references needed translating Expr::Column (core/translate/expr/translator.rs:2408)
fkey1 11 bytes[bytes.len() - 1] == bytes[0] (sqlite/parser/src/ast.rs:1282)

Five timeouts: trans2, notify2, walsetlk3, walsetlk_recover, and now lock4 (above).

Major remaining issues

Counts are over the per-file logs of this run. Where a number matches the last report, it is the same failures.

Engine bugs

  • Indexed expressions read from the index inside larger expressions (new, above): JSON subtype and COLLATE lost, indexexpr1-1910/-1920/-2211…-2300
  • Whole-table DELETE under an open SELECT panics (from the last report, still open): misc2-7.16, same assertion as rollback2
  • Expression index under a LEFT JOIN: where-20.0 still counts 1 row where SQLite counts 0. The only one of the outer-join wrong results from the last report that is still open
  • Views with a column list over VALUES: CREATE VIEW t2(c,d) AS VALUES(3,33),(4,44) ignores the column list, and SELECT c FROM t2 fails with no such column: c. 58 of the 63 join7 failures (cases 6 and 7)
  • PRAGMA wal_autocheckpoint=OFF rejected and WAL shrinks after an automatic checkpoint (new, above)
  • Corruption handling: damaged files either fail to open or panic (four files above) instead of database disk image is malformed (115 expected values say so)
  • A second process cannot open a database (14 multi-connection files)
  • notify1 (112 failures): reads that SQLite blocks with database is locked under shared cache succeed in Turso

FULLSCAN_STEP counter mismatches (435, where7 only, unchanged)

Results match, counters do not (scan 99 vs scan 0 on multi-term OR clauses). Plus 19 × Expression tree is too large (maximum depth 100), 6 of them in where7.

SQL feature gaps

RIGHT JOIN, FULL OUTER JOIN and parenthesized FROM are gone from this list. Unchanged:

  • WITHOUT ROWID: 434 error lines (foreign keys 58, DELETE 50, CREATE INDEX 46, UPDATE 40, secondary UNIQUE 30); without_rowid3 (521) and conflict2 (129) are the big cascades
  • InTable position errors: 112; compound SELECT in WHERE subqueries: 70; ORDER BY inside aggregates: 24; INSTEAD OF triggers: 46
  • Ordered-set aggregates: WITHIN GROUP for percentile() and median(), and window use of extension aggregates
  • Custom collations in schema definitions (29), which cascade in collate2 (109 no such table: collate2t1)
  • Test-only functions the suite calls: ieee754 33, sqlite_compileoption_used 25, sqlite_rename_table 19, affinity 16, prefix_length 14; modules: 73 (was 295 before csv), mostly unionvtab 26, swarmvtab 13, echo 12

Missing TCL test commands (263 invalid command name, was 285)

sqlite3_prepare_v3 (49), db cascade (32), sqlite3_expired (31), decode_hexdb (25), sqlite3_get_table_printf (24), db2 (11), sqlite3_delete_database (10), utf8_to_utf8 (7). Also 52 × db complete, a subcommand the binding does not have. TCL can't read variable failures: 189 (was 195).

Worst files by failure count

File Tests Failures Dominant cause
without_rowid3.test 1,197 521 WITHOUT ROWID gaps
where7.test 2,026 442 FULLSCAN_STEP counter mismatch (scan 99 vs scan 0)
sqllimits1.test 489 342 limits not enforced
corruptF.test 268 260 damaged file rejected at open
e_walckpt.test 240 134 checkpoint results and second-process open (abort)
conflict2.test 139 129 WITHOUT ROWID cascade
unionvtab.test 115 112 unionvtab module missing
notify1.test 228 112 no shared-cache table locks (abort)
collate2.test 119 110 custom collation in the schema, then cascade
tkt-9d68c883.test 101 101 incremental auto-vacuum, then cascade

joinD, joinB, csv01, joinC, wal3 and join7, five of the ten worst files last time, have left the table.

Conclusion

The pass rate rose 0.8 points. RIGHT JOIN, FULL OUTER JOIN and parenthesized FROM clauses now work. Together they made up 1,601 error lines in the last report, five join files are blessed, and five of the six outer-join wrong results from the last report are fixed. The new problem is fc3222017: reading nested indexed expressions from the index without checking that the stored value is equivalent. That loses JSON subtypes and collations and gives wrong answers in indexexpr1. SQLite does not use the index in these cases, and Turso should check for the same conditions. Still open from the last report: the misc2 panic on a whole-table DELETE under an open SELECT, and the where-20.0 wrong count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment