Commit d76886c2 authored by Tom Lane's avatar Tom Lane

Dept of second thoughts: keep aliasp_item in sync with tlistitem.

Commit d5b760ec 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.
parent d5b760ec
......@@ -2221,7 +2221,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)
......@@ -2237,6 +2236,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
*colvars = lappend(*colvars, varnode);
}
aliasp_item = lnext(aliasp_item);
}
}
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment