Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/backend/parser/cypher_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ static List *expand_pnsi_attrs(ParseState *pstate, ParseNamespaceItem *pnsi,
List *te_list = NIL;
int var_prefix_len = strlen(AGE_DEFAULT_VARNAME_PREFIX);
int alias_prefix_len = strlen(AGE_DEFAULT_ALIAS_PREFIX);
int vle_prefix_len = strlen(AGE_DEFAULT_PREFIX "vle_function_");

vars = expandNSItemVars(pstate, pnsi, sublevels_up, location, &names);

Expand Down Expand Up @@ -212,6 +213,16 @@ static List *expand_pnsi_attrs(ParseState *pstate, ParseNamespaceItem *pnsi,
if (strncmp(AGE_DEFAULT_ALIAS_PREFIX, label, alias_prefix_len) == 0)
continue;

/*
* Skip the internal VLE helper columns (created in cypher_gram.y via
* create_unique_name(AGE_DEFAULT_PREFIX"vle_function_{start,end}_var")).
* These feed the vle() SRF's start/end bound vars and are visible in
* the namespace, but they are implementation details and must not show
* up in RETURN * projections alongside the user's variables.
*/
if (strncmp(AGE_DEFAULT_PREFIX "vle_function_", label, vle_prefix_len) == 0)
continue;

/* add this variable to the list */
te = makeTargetEntry((Expr *)varnode,
(AttrNumber)pstate->p_next_resno++, label, false);
Expand Down
Loading