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 simulator makes exact-row assertions, and it cannot predict a
post-rollback rowid without modeling that watermark. Rather than model
it, generate 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.
Check MVCC integrity with Turso, which can read the logical-log state
SQLite cannot, and keep the SQLite integrity check for WAL. Export the
logical log from the in-memory I/O so a retained failure artifact
includes committed state.
Tests: 21 generator tests, the MVCC profile regression, and
deterministic integrity and export regressions pass.
Extend SQL generation and simulator models to produce and validate
tables with VIRTUAL generated columns.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
property: add insert atomicity via unique violations
shadow: allow multiple nulls in unique columns
sql_generation: strip unique from alter column
shadow: assert else_column matches target in casewhen
shadow: check insert batch for duplicates
simulator: simplify UNIQUE validation and StatementAtomicity
remove some hacks
add bounds to loop to avoid a super rare edge case where it could go to infinite-loop
fmt and clippy
remove unused snapshot_after_dml
sql_generation: add SetValue enum for UPDATE assignments
sql_generation: add UpdateOpts and table helper methods
sql_generation: add CASE WHEN generation for updates