Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 291a31c

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 ddde3b4 commit 291a31c

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

22222222
*colnames = lappend(*colnames, makeString(pstrdup(label)));
2223-
aliasp_item = lnext(aliasp_item);
22242223
}
22252224

22262225
if (colvars)
@@ -2236,6 +2235,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
22362235

22372236
*colvars = lappend(*colvars, varnode);
22382237
}
2238+
2239+
aliasp_item = lnext(aliasp_item);
22392240
}
22402241
}
22412242
break;

0 commit comments

Comments
 (0)