fix: X4 — advanced-mode SQL INSERT auto-fills omitted non-PK serial (MAX+1)
A Form-A advanced-mode INSERT that omitted a non-PK serial column left it silently NULL (the column is INTEGER UNIQUE, not NOT NULL, so SQLite permits it), while simple-mode do_insert auto-fills it with MAX+1. That violated ADR-0018 §1's "auto-generated on every path" contract and was the unprincipled serial-vs-shortid asymmetry the ADR set out to remove (advanced mode already auto-fills shortid). Fix (decision: advanced mode matches simple mode): the advanced-mode auto-fill reconstruction — renamed plan_shortid_autofill → plan_autogen_autofill — now also fills an omitted non-PK serial with MAX(col)+1 … MAX+n per row (single- and multi-row), reading MAX once under the worker's single-writer serialisation. PK serial stays on the rowid alias; Form B (no column list) still supplies every column. Honours ADR-0018 §1/§5; no ADR amendment needed (the contract already said "every path"). requirements.md X4 marked resolved. Tests: 1949 passing (+1), 0 failed, 0 skipped, 1 ignored; clippy clean.
This commit is contained in:
@@ -105,7 +105,7 @@ fn fallback_value_list() -> Node {
|
||||
/// `VALUES` position, so it is correctly absent here.
|
||||
/// - **Form B** (no column list): ALL columns in declaration order,
|
||||
/// including `serial` / `shortid` — advanced-mode Form B auto-fills
|
||||
/// *nothing* (`plan_shortid_autofill` returns early on an empty
|
||||
/// *nothing* (`plan_autogen_autofill` returns early on an empty
|
||||
/// column list), so the user supplies a value for every column.
|
||||
///
|
||||
/// Empty when schemaless, the table is unknown, or a Form A list
|
||||
|
||||
Reference in New Issue
Block a user