jrgemignani commented on code in PR #469:
URL: https://github.com/apache/age/pull/469#discussion_r1098097903
##########
src/backend/parser/cypher_clause.c:
##########
@@ -760,12 +771,12 @@ transform_cypher_union_tree(cypher_parsestate *cpstate,
cypher_clause *clause,
*/
snprintf(returnName, sizeof(returnName), "*SELECT* %d ",
list_length(pstate->p_rtable) + 1);
- rte = addRangeTableEntryForSubquery(pstate,
+ pnsi = addRangeTableEntryForSubquery(pstate,
returnQuery,
Review Comment:
need adjusted
##########
src/backend/parser/cypher_clause.c:
##########
@@ -4586,8 +4616,9 @@ transform_create_cypher_new_node(cypher_parsestate
*cpstate,
// Store the relid
rel->relid = RelationGetRelid(label_relation);
- rte = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
+ pnsi = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
AccessShareLock, NULL, false, false);
Review Comment:
needs adjustment
##########
src/backend/parser/cypher_clause.c:
##########
@@ -5601,5 +5639,24 @@ static void handle_prev_clause(cypher_parsestate
*cpstate, Query *query,
}
// add all the rte's attributes to the current queries targetlist
- query->targetList = expandRelAttrs(pstate, rte, rtindex, 0, -1);
+ query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
+}
+
+ParseNamespaceItem *find_pnsi(cypher_parsestate *cpstate, char *varname)
+{
+ ParseState *pstate = (ParseState *) cpstate;
+ ListCell *lc;
+
+ foreach (lc, pstate->p_namespace)
+ {
+ ParseNamespaceItem *pnsi = (ParseNamespaceItem *)lfirst(lc);
+ Alias *alias = pnsi->p_rte->alias;
+ if (!alias)
+ continue;
Review Comment:
needs {}
##########
src/backend/parser/cypher_clause.c:
##########
@@ -5479,8 +5517,9 @@ transform_merge_cypher_node(cypher_parsestate *cpstate,
List **target_list,
// Store the relid
rel->relid = RelationGetRelid(label_relation);
- rte = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
+ pnsi = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
AccessShareLock, NULL, false, false);
Review Comment:
may need adjustment
##########
src/backend/parser/cypher_clause.c:
##########
@@ -5374,8 +5410,9 @@ transform_merge_cypher_edge(cypher_parsestate *cpstate,
List **target_list,
// Store the relid
rel->relid = RelationGetRelid(label_relation);
- rte = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
+ pnsi = addRangeTableEntryForRelation((ParseState *)cpstate, label_relation,
AccessShareLock, NULL, false, false);
Review Comment:
may need adjustment
##########
src/backend/parser/cypher_clause.c:
##########
@@ -5601,5 +5639,24 @@ static void handle_prev_clause(cypher_parsestate
*cpstate, Query *query,
}
// add all the rte's attributes to the current queries targetlist
- query->targetList = expandRelAttrs(pstate, rte, rtindex, 0, -1);
+ query->targetList = expandNSItemAttrs(pstate, pnsi, 0, -1);
+}
+
+ParseNamespaceItem *find_pnsi(cypher_parsestate *cpstate, char *varname)
+{
+ ParseState *pstate = (ParseState *) cpstate;
+ ListCell *lc;
+
+ foreach (lc, pstate->p_namespace)
+ {
+ ParseNamespaceItem *pnsi = (ParseNamespaceItem *)lfirst(lc);
+ Alias *alias = pnsi->p_rte->alias;
+ if (!alias)
+ continue;
+
+ if (!strcmp(alias->aliasname, varname))
+ return pnsi;
Review Comment:
needs {}
--
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]