gregfelice commented on PR #2380:
URL: https://github.com/apache/age/pull/2380#issuecomment-4275922599
Pushed a one-line fix (bc891bfb).
**Root cause:** In `transform_cypher_optional_match_clause` I called
`transform_cypher_expr` with `EXPR_KIND_JOIN_ON` when re-attaching the detached
WHERE as the LEFT JOIN's ON condition. All other WHERE transforms in
`cypher_clause.c` use `EXPR_KIND_WHERE`, and there are three explicit
`p_expr_kind == EXPR_KIND_WHERE` guards (`cypher_clause.c:5415`, `5679`,
`6597`) that do load-bearing variable resolution for sub-pattern predicates —
walking up parent parsestates to rebind variables like `friend` inside `EXISTS
{ (friend)-[...]->(...) }`. `EXPR_KIND_JOIN_ON` bypassed those guards, so the
sub-pattern fell through to the "create new variable" path and produced a
structurally invalid parse tree — silently tolerated on a release PG build but
caught by `--enable-cassert`.
**Why I didn't catch it:** my local PG18 is the stock Ubuntu package (no
`--enable-cassert`), so all 32 regression tests passed locally before I opened
the PR. Setting up a dedicated `--enable-cassert` PG build locally now so this
class of failure can't slip past me again. Thanks for flagging
@MuhammadTahaNaveed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]