mirror of
https://github.com/postgres/postgres.git
synced 2025-06-01 14:21:49 +03:00
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.
This commit is contained in:
parent
ddde3b4f3e
commit
291a31c42c
@ -2220,7 +2220,6 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
|
|||||||
char *label = strVal(lfirst(aliasp_item));
|
char *label = strVal(lfirst(aliasp_item));
|
||||||
|
|
||||||
*colnames = lappend(*colnames, makeString(pstrdup(label)));
|
*colnames = lappend(*colnames, makeString(pstrdup(label)));
|
||||||
aliasp_item = lnext(aliasp_item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colvars)
|
if (colvars)
|
||||||
@ -2236,6 +2235,8 @@ expandRTE(RangeTblEntry *rte, int rtindex, int sublevels_up,
|
|||||||
|
|
||||||
*colvars = lappend(*colvars, varnode);
|
*colvars = lappend(*colvars, varnode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aliasp_item = lnext(aliasp_item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user