mirror of
https://github.com/allankoechke/turso.git
synced 2026-11-29 09:33:48 +00:00
Under MVCC, implicit rowid allocation behaves like a sequence: the next value comes from a high-water mark that a rollback does not lower, so an aborted insert consumes its rowid for good and the next insert skips past it. This is deliberate — we do not guarantee that a rolled-back allocation is handed back, matching PostgreSQL sequences, where `nextval` is never rolled back and aborted transactions leave permanent gaps. (AUTOINCREMENT already behaved this way; the same rule now covers plain `INTEGER PRIMARY KEY` rowids.) WAL mode, like SQLite, reuses the freed value. The differential simulator makes exact-row assertions, and it cannot predict a post-rollback rowid without modeling that watermark. Rather than model it, this generates explicit integer primary keys in MVCC INSERT and UPSERT workloads, so the assertions no longer assume rolled- back allocations come back. WAL mode keeps generating implicit keys. It also splits validation by mode: MVCC integrity is checked with Turso (which can read the logical-log state SQLite cannot) while WAL keeps the SQLite check, and the in-memory I/O now exports the logical log so a retained failure artifact includes committed state. Tests: 21 generator tests, the MVCC profile regression, and deterministic integrity and export regressions pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-by: Pere Diaz Bou <pere-altea@homail.com> Closes #9806
Turso Testing
Testing Extensions
When adding tests for extensions, please follow these guidelines:
- Tests that verify the internal logic or behavior of a particular extension should go into
cli_tests/extensions.py. - Tests that verify how extensions interact with the database engine, such as virtual table handling, should be written
in TCL (see
vtab.testas an example).
To check which extensions are available in TCL, or to add a new one, refer to the tester.tcl file and look at the extension_map.