-
-
Notifications
You must be signed in to change notification settings - Fork 17
INSERT..SELECT with a kv-engine source silently NULLs expression cells #311
Copy link
Copy link
Open
Labels
area:sqlParser, planner, SQL semanticsParser, planner, SQL semanticsengine:kvKey-Value engineKey-Value enginepriority:P2Scheduled, not urgentScheduled, not urgentsev:3-mediumFeature wrong, but operational and a workaround existsFeature wrong, but operational and a workaround existsstatus:confirmedReproduced by a maintainerReproduced by a maintainertype:bugA defect — broken, incorrect, or lost dataA defect — broken, incorrect, or lost data
Description
Activity
Metadata
Metadata
Assignees
Labels
area:sqlParser, planner, SQL semanticsParser, planner, SQL semanticsengine:kvKey-Value engineKey-Value enginepriority:P2Scheduled, not urgentScheduled, not urgentsev:3-mediumFeature wrong, but operational and a workaround existsFeature wrong, but operational and a workaround existsstatus:confirmedReproduced by a maintainerReproduced by a maintainertype:bugA defect — broken, incorrect, or lost dataA defect — broken, incorrect, or lost data
Summary
INSERT INTO dst (id) SELECT <expr> FROM srcsilently writes NULL for theexpression column when the source is a kv-engine collection. The
copy_rows column-map drops expression projections for kv sources, so the
cell is never evaluated — no error, no value.
Evidence
SELECT 1 + 1 FROM kvreturned an empty column until kv scan projectionswere fixed in feat(sql): evaluate sequence accessors in constant contexts and kv projections #307 (KvOp::Scan now carries projection + computed columns).
accessor there (
SELECT nextval('s') FROM kvsrc) inserts NULL silentlyinstead of raising 0A000 like document/columnar sources do. Pinned as a
known gap in the sequence_matrix wire suite (in-test note).
Expected
Expression cells over kv sources evaluate per row with the same semantics
as other engines (or fail loudly, never silently NULL).
Related: #303, #307, #294
Reproduction
Reproduced on main dd2ed01 and on the PR #307 branch (the gap is in the
copy_rows column-map for kv sources, independent of the kv scan fix).