Skip to content

Commit d01d97c

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 6610411 commit d01d97c

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

18461846
*colnames = lappend(*colnames, makeString(pstrdup(label)));
1847-
aliasp_item = lnext(aliasp_item);
18481847
}
18491848

18501849
if (colvars)
@@ -1860,6 +1859,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
18601859

18611860
*colvars = lappend(*colvars, varnode);
18621861
}
1862+
1863+
aliasp_item = lnext(aliasp_item);
18631864
}
18641865
}
18651866
break;

0 commit comments

Comments
 (0)