1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

Don't generate fake "*TLOCRN*" or "*TROCRN*" aliases, either.

This is just like the previous two commits, except that this fix
actually doesn't change any regression test outputs.

Author: Robert Haas <rhaas@postgresql.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CA+TgmoYSYmDA2GvanzPMci084n+mVucv0bJ0HPbs6uhmMN6HMg@mail.gmail.com
This commit is contained in:
Robert Haas
2025-09-08 12:58:07 -04:00
parent 6f79024df3
commit 5a170e992a

View File

@@ -282,8 +282,8 @@ rewriteSearchAndCycle(CommonTableExpr *cte)
newrte = makeNode(RangeTblEntry);
newrte->rtekind = RTE_SUBQUERY;
newrte->alias = makeAlias("*TLOCRN*", cte->ctecolnames);
newrte->eref = newrte->alias;
newrte->alias = NULL;
newrte->eref = makeAlias("*TLOCRN*", cte->ctecolnames);
newsubquery = copyObject(rte1->subquery);
IncrementVarSublevelsUp((Node *) newsubquery, 1, 1);
newrte->subquery = newsubquery;
@@ -379,8 +379,8 @@ rewriteSearchAndCycle(CommonTableExpr *cte)
ewcl = lappend(ewcl, makeString(cte->cycle_clause->cycle_mark_column));
ewcl = lappend(ewcl, makeString(cte->cycle_clause->cycle_path_column));
}
newrte->alias = makeAlias("*TROCRN*", ewcl);
newrte->eref = newrte->alias;
newrte->alias = NULL;
newrte->eref = makeAlias("*TROCRN*", ewcl);
/*
* Find the reference to the recursive CTE in the right UNION subquery's