Commit Graph

15 Commits

Author SHA1 Message Date
Glauber Costa
e6f0981b43 simulator: correct MVCC rowid assumptions and validation
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.
2026-10-12 19:56:09 -05:00
Claude
b2635b4ba5 simulator: add virtual generated columns support to the simulator
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>
2026-05-18 13:28:25 -04:00
webhop123
28666bb1b7 simulator: add savepoint rollback DST coverage 2026-04-30 00:42:11 +01:00
Pavan-Nambi
3af0d60107 sql_generation: add upsert 2026-02-10 05:22:54 +05:30
Pavan-Nambi
73015e4c1f shadow: add unique constraint checking
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
2026-01-27 19:11:45 +05:30
Pavan-Nambi
ad092145d7 sql_generation: add UNIQUE constraint generation
sql_generation: add SetValue enum for UPDATE assignments

sql_generation: add UpdateOpts and table helper methods

sql_generation: add CASE WHEN generation for updates
2026-01-27 19:11:44 +05:30
Jussi Saurio
826ca4d44d chore: remove experimental_indexes feature flags 2025-12-08 13:00:37 +02:00
Mikaël Francoeur
cb4fc15e06 generate arbitrary self-inserts 2025-12-02 21:35:03 -05:00
pedrocarlo
c0f35cc17d disable ALTER COLUMN due to incompatibility with SQLITE INTEGRITY CHECK 2025-10-13 02:34:43 -03:00
pedrocarlo
a18a472685 add option to disable alter column for differential testing 2025-10-13 02:34:43 -03:00
pedrocarlo
a1407869d4 add serde, schemars and garde to profiles and options 2025-08-30 11:31:52 -03:00
pedrocarlo
bc6976fd33 add Select and Insert generation options 2025-08-30 11:31:52 -03:00
pedrocarlo
9bc8bdb279 all Arbitrary traits need to pass a GenerationContext 2025-08-30 11:31:52 -03:00
pedrocarlo
1a8b78afd8 create ArbitraryContext and ArbitraryContextFrom traits to pass generation context + start implementing them in Table + FromClause 2025-08-30 11:31:52 -03:00
pedrocarlo
e0552629e3 create Generation Options structs 2025-08-30 11:31:52 -03:00