Add missing initializations of p_perminfo

In a61b1f7482, we failed to update transformFromClauseItem() and
buildNSItemFromLists() to set ParseNamespaceItem.p_perminfo causing
it to point to garbage.

Pointed out by Tom Lane.

Reported-by: Farias de Oliveira <matheusfarias519@gmail.com>
Discussion: https://postgr.es/m/3173476.1689286373%40sss.pgh.pa.us
Backpatch-through: 16
This commit is contained in:
Amit Langote 2023-07-14 14:28:38 +09:00
parent 27da471220
commit 4a7301c7ad
2 changed files with 2 additions and 0 deletions

View File

@ -1573,6 +1573,7 @@ transformFromClauseItem(ParseState *pstate, Node *n,
jnsitem->p_names = j->join_using_alias;
jnsitem->p_rte = nsitem->p_rte;
jnsitem->p_rtindex = nsitem->p_rtindex;
jnsitem->p_perminfo = NULL;
/* no need to copy the first N columns, just use res_nscolumns */
jnsitem->p_nscolumns = res_nscolumns;
/* set default visibility flags; might get changed later */

View File

@ -1392,6 +1392,7 @@ buildNSItemFromLists(RangeTblEntry *rte, Index rtindex,
nsitem->p_names = rte->eref;
nsitem->p_rte = rte;
nsitem->p_rtindex = rtindex;
nsitem->p_perminfo = NULL;
nsitem->p_nscolumns = nscolumns;
/* set default visibility flags; might get changed later */
nsitem->p_rel_visible = true;