Skip to content

Commit 21daada

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 7e5e8b3 commit 21daada

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
@@ -2028,7 +2028,6 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
20282028
char *label = strVal(lfirst(aliasp_item));
20292029

20302030
*colnames = lappend(*colnames, makeString(pstrdup(label)));
2031-
aliasp_item = lnext(aliasp_item);
20322031
}
20332032

20342033
if (colvars)
@@ -2044,6 +2043,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
20442043

20452044
*colvars = lappend(*colvars, varnode);
20462045
}
2046+
2047+
aliasp_item = lnext(aliasp_item);
20472048
}
20482049
}
20492050
break;

0 commit comments

Comments
 (0)