postgres.git / summary / log / commit / refs

commit    21daada10ebf444fb1fc06a705fb22b890867083
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Oct 27 22:16:25 2017 +0000
First released in: 11.0, 9.2.24, 9.3.20, 9.4.15, 9.5.10, 9.6.6, 10.1

    Dept of second thoughts: keep aliasp_item in sync with tlistitem.
    
    Commit d5b760ecb 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.


src/backend/parser/parse_relation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c index f4542b099e8..38ef66dbcee 100644 --- a/src/backend/parser/parse_relation.c +++ b/src/backend/parser/parse_relation.c @@ -2028,7 +2028,6 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, char *label = strVal(lfirst(aliasp_item)); *colnames = lappend(*colnames, makeString(pstrdup(label))); - aliasp_item = lnext(aliasp_item); } if (colvars) @@ -2044,6 +2043,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up, *colvars = lappend(*colvars, varnode); } + + aliasp_item = lnext(aliasp_item); } } break; [parent: 7e5e8b36d478]