summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Langote2023-07-14 05:28:38 +0000
committerAmit Langote2023-07-14 05:56:35 +0000
commit00f2a2556c9b23050e4f987e5d563b6856b83fc2 (patch)
tree334c1a212506aa81a514888ddc1ba619249d04c2
parenta0363ab7aafda7d16ae59e72d86866c02ad3d657 (diff)
Add missing initializations of p_perminfo
In a61b1f74823, 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 <[email protected]> Discussion: https://postgr.es/m/3173476.1689286373%40sss.pgh.pa.us Backpatch-through: 16
-rw-r--r--src/backend/parser/parse_clause.c1
-rw-r--r--src/backend/parser/parse_relation.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c
index f61f7947552..334b9b42bd5 100644
--- a/src/backend/parser/parse_clause.c
+++ b/src/backend/parser/parse_clause.c
@@ -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 */
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 41d60494b97..864ea9b0d5d 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -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;