MuhammadTahaNaveed commented on code in PR #931:
URL: https://github.com/apache/age/pull/931#discussion_r1213314852
##########
src/backend/parser/cypher_parse_node.c:
##########
@@ -131,9 +131,20 @@ RangeTblEntry *find_rte(cypher_parsestate *cpstate, char
*varname)
*/
char *get_next_default_alias(cypher_parsestate *cpstate)
{
+ ParseState *pstate = (ParseState *)cpstate;
+ cypher_parsestate *parent_cpstate = (cypher_parsestate
*)pstate->parentParseState;
char *alias_name;
int nlen = 0;
+ /*
+ * Every clause transformed as a subquery has its own cpstate which is
being
+ * freed after it is tranformed. The root cpstate is the one that has the
+ * default alias number initialized. So we need to reach the root cpstate
to
+ * get the next correct default alias number.
+ */
+ if (parent_cpstate)
Review Comment:
Fixed it
--
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]