Skip to content

[bisect] c3 3c12e61 — dispatcher var_map threading#64

Closed
dylanbstorey wants to merge 3 commits into
mainfrom
bisect/c3-3c12e61
Closed

[bisect] c3 3c12e61 — dispatcher var_map threading#64
dylanbstorey wants to merge 3 commits into
mainfrom
bisect/c3-3c12e61

Conversation

@dylanbstorey
Copy link
Copy Markdown
Contributor

Bisect probe — do not merge

Dylan Bobby Storey added 3 commits April 18, 2026 17:42
…ERGE

Resolves two data-loss bugs from issue #61 where parameterized relationship
properties silently became NULL, plus plumbs ON CREATE / ON MATCH SET through
to edge variables (previously stubbed "not yet implemented").

- executor_create.c: add AST_NODE_PARAMETER branch to the rel-create
  property loop, mirroring the existing node path. Refactor the LITERAL
  branch so set_edge_property is called once after the if/else chain.
  Fixes GQLITE-T-0186 (#61.2).

- executor_merge.c: same PARAMETER handling in both MERGE entry points,
  and replace the "not yet implemented for relationship variables" debug
  stubs with real execute_set_items calls. Broaden ON CREATE trigger to
  fire when the MERGE produced either a new edge or a new target
  endpoint. Fixes GQLITE-T-0187 (#61.3).

- tests/functional/39_issue_regression_tests.sql: regression coverage
  for #61.2 (text/int/real/bool params on rel inline props) and #61.3
  (MERGE rel inline $param plus ON CREATE SET $param).

Also filed Metis tickets and RCA for the remaining five sub-bugs of
issue #61 (T-0185, T-0188, T-0189, T-0190, T-0191) — all marked blocked
with detailed findings. Initiatives GQLITE-I-0035 (semantic coverage
matrix) and GQLITE-I-0036 (cross-clause var_map threading) scope the
follow-on work.
Break down the cross-clause variable-map threading initiative into
concrete, independently-landable tasks ordered for incremental value:

- T-0193 (S): expose execute_merge_clause_with_varmap variant
- T-0194 (S): wire handle_create to run trailing SET  -> resolves T-0188/CREATE
- T-0195 (S): wire handle_merge to run trailing SET   -> resolves T-0188/MERGE
- T-0196 (M): thread MATCH+MERGE var_map to trailing SET -> resolves T-0189
- T-0197 (M-L): aggregate multi-MATCH bindings        -> resolves T-0190
- T-0198 (S): cross-clause dispatch smoke tests
- T-0199 (XS): close blocked bugs, promote regression tests

Initiative advanced: discovery -> design -> ready -> decompose.
Lands GQLITE-I-0036 (cross-clause var_map threading in the dispatch layer).
Closes five previously-blocked issue #61 sub-bugs with no changes to the
SET, MERGE, CREATE, or MATCH implementations themselves — this is pure
plumbing in src/backend/executor/query_dispatch.c plus new _with_varmap
variants of the clause executors.

New public API (src/include/executor/executor_internal.h):
- execute_merge_clause_with_varmap(..., out_var_map)   [T-0193]
- execute_match_merge_query_with_varmap(..., out_var_map) [T-0196]
- execute_multi_match_create_query(query, create, ...)  [T-0197]
- bind_match_clause_into_varmap(...)                    [T-0197 helper]

Dispatcher wiring (query_dispatch.c):
- handle_create detects trailing SET and threads CREATE's var_map [T-0194]
- handle_merge detects trailing SET and threads MERGE's var_map   [T-0195]
- handle_match_merge threads MATCH+MERGE var_map into SET         [T-0196]
- handle_match_create routes multi-MATCH queries to the new
  execute_multi_match_create_query which unions every MATCH's
  bindings before CREATE runs                                      [T-0197]
- MATCH+SET dispatch entry now forbids MERGE/CREATE so compound
  MATCH+MERGE+SET / MATCH+CREATE+SET patterns route to the right
  handler instead of silently dropping the write clause

Resolved bugs:
- GQLITE-T-0188 (bug #61.4): SET n += {map} silently NULL
- GQLITE-T-0189 (bug #61.5): "Unbound variable in SET: r" after MERGE rel
- GQLITE-T-0190 (bug #61.6): target node properties NULL after MATCH
  ... MATCH ... CREATE rel (was a phantom-node bug, not a traversal bug)

Regression coverage in tests/functional/39_issue_regression_tests.sql:
- T-0194a/b/c: CREATE + SET scalar / += map / += $param
- T-0195a/b/c: MERGE + SET scalar / += map / ON-CREATE-SET + trailing SET
- T-0196:      MATCH + MERGE rel + trailing SET on rel var
- T-0197a/b/c: multi-MATCH + CREATE rel, traversal read-back, $param
- T-0198a/b:   MATCH+MATCH+MERGE matrix cells, with known-hole callouts

Known holes (future work; scoped out of this initiative):
- MATCH+CREATE (single MATCH) + trailing SET
- MATCH+MATCH+SET (no intervening write)
- GQLITE-T-0185 (UNWIND transform), GQLITE-T-0191 (multi-property MATCH
  alias reuse), GQLITE-T-0192 (diagnostics API) remain open — independent
  of this initiative.
@dylanbstorey
Copy link
Copy Markdown
Contributor Author

Closing: bisect complete, see GQLITE-T-0205. Windows regression is pre-existing runner-image drift.

@dylanbstorey dylanbstorey deleted the bisect/c3-3c12e61 branch April 19, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant