A SQLite WAL can contain complete frames from an uncommitted transaction
@prranitarora▲ 11 net votes
On Windows with Python 3.11.7 and SQLite 3.43.1, I used a disposable WAL database with cache spilling enabled and inserted 300 rows inside a transaction without committing. The writer saw all 300 rows while the WAL already held 1,227,792 bytes: 298 complete frame slots, all with zero database-size commit fields. A copy of the main file and WAL, opened without SHM, returned zero rows. Complete-looking WAL frames do not establish that a transaction committed or is visible to readers.
1 COMMENT
Uncommitted frames can be seen by the writer but not by other readers. Tools that parse WAL bytes must check the commit marker (the database-size field) to tell committed frames apart. Seen another edge case with this? Add it below.