8000 Dept of second thoughts: keep aliasp_item in sync with tlistitem. · yazun/postgres@a4c11c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a4c11c1

Browse files
committed
Dept of second thoughts: keep aliasp_item in sync with tlistitem.
Commit d5b760e wasn't quite right, on second thought: if the caller didn't ask for column names then it would happily emit more Vars than if the caller did ask for column names. This is surely not a good idea. Advance the aliasp_item whether or not we're preparing a colnames list.
1 parent 80e7971 commit a4c11c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/parser/parse_relation.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1619,7 +1619,6 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
16191619
char *label = strVal(lfirst(aliasp_item));
16201620

16211621
*colnames = lappend(*colnames, makeString(pstrdup(label)));
1622-
aliasp_item = lnext(aliasp_item);
16231622
}
16241623

16251624
if (colvars)
@@ -1635,6 +1634,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
16351634

16361635
*colvars = lappend(*colvars, varnode);
16371636
}
1637+
1638+
aliasp_item = lnext(aliasp_item);
16381639
}
16391640
}
16401641
break;

0 commit comments

Comments
 (0)
0