Skip to content

Commit 39e696a

Browse files
authored
Add an additional way to find a previous variable ref (#1450) (#1480)
Added an additional way to find a previous variable reference to `transform_column_ref_for_indirection`. There was no impact on current regression tests. Resolved - Conflicts: src/backend/parser/cypher_expr.c
1 parent 2541273 commit 39e696a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/backend/parser/cypher_expr.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,16 @@ static Node *transform_column_ref_for_indirection(cypher_parsestate *cpstate,
841841
/* locate the referenced RTE */
842842
rte = find_rte(cpstate, relname);
843843

844-
/* if we didn't find anything, return NULL */
844+
/*
845+
* If we didn't find anything, try looking for a previous variable
846+
* reference. Otherwise, return NULL (colNameToVar will return NULL
847+
* if nothing is found).
848+
*/
845849
if (!rte)
846850
{
847-
return NULL;
851+
Node *prev_var = colNameToVar(pstate, relname, false, cr->location);
852+
853+
return prev_var;
848854
}
849855

850856
/* find the properties column of the NSI and return a var for it */

0 commit comments

Comments
 (0)