Keep unstaged views and triggers out of named-add commits#1652
Conversation
Views and triggers have no catalog entries, and the catalog row filter marks entry-less rows as always wanted, so their inclusion in a commit was decided by whichever master root the staged catalog carried: a named dolt_add whose table had a schema change adopted the working master wholesale and dragged unstaged view and trigger changes into the commit, while the same add without a schema change left them out — inconsistent, and Dolt keeps unstaged schema objects out of named adds. The staged master is now composed instead of adopted: table and index rows (including virtual tables and shadows) come from the working master so the staged entries share its numbering domain, while view and trigger rows keep the previously staged state. Staging surfaces that legitimately carry views — add -A and commit -a, matching Dolt's tracked-dolt_schemas behavior — are unchanged, previously staged views survive later named adds, and the working state keeps its uncommitted view after the commit. Fixes #1648 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Version-Control Performance CeilingsRuns: median of 3 executions per benchmark, excluding fixture setup. The
|
Sysbench-Style Benchmark: Doltlite vs SQLiteIn-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (TEXT PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (composite PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Sysbench-Style Benchmark (BLOB PK): Doltlite vs SQLiteCompanion to the classic Sysbench-Style Benchmark. Every workload here In-MemoryReads
Writes
File-BackedReads
Writes
File-Backed (autocommit)Each statement runs as its own transaction — exposes per-commit ReadsReads have no commit cost; these are the same SQL files as the
Writes
100000 rows, median of 5 invocations per test; autocommit writes use 9, workload-only timing via host monotonic clock when available. Performance Ceiling Check (2.5x individual, 2x average; autocommit writes: 6x / 5x)All tests within ceilings. |
Fixes #1648, the last open item from the schema-object staging survey.
Views and triggers are entry-less (schema rows only) and the row filter marks them always-wanted, so commit inclusion was decided entirely by which master root the staged catalog carried — a named
dolt_add('t')with a schema change ontadopted the working master wholesale and dragged never-staged views/triggers into the commit; without the schema change they stayed out. Inconsistent, and contrary to Dolt (verified against real Dolt: named adds keep unstaged schema objects out;-acarries them when dolt_schemas is tracked).The fix composes the staged master instead of adopting it (
doltliteBuildNamedStageMasterRoot): table/index rows — including vtabs and shadows — come from the working master so the staged entries keep its numbering domain (the #1616 constraint that forced wholesale adoption in the first place), while view and trigger rows keep the previously staged state.Verified semantics: the #1648 repro commits the table's schema change without the view/trigger;
add -Aandcommit -amstill carry views (Dolt's tracked-dolt_schemas analog); previously staged views survive later named adds; the working state keeps its uncommitted view after the commit; vtab shadow staging (#1647) unaffected.Gating tests in
doltlite_commit.shfail on master (54/56) and pass with the fix (56/56).Also split out while verifying: #1651 —
dolt_statusis blind to view/trigger-only changes (pre-existing; more visible now that named adds correctly exclude them).Validation: battery 88/88, C regression 309,830/309,830, index×VC matrix 38/38, oracles vs real Dolt: add 27/27, commit 37/37, reset 43/43.
🤖 Generated with Claude Code