agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
Subject: [PATCH v25 4/9] change ConcatRTEPermissionInfoLists API
Date: Tue, 15 Nov 2022 19:22:45 +0100
---
src/backend/optimizer/plan/subselect.c | 5 +++--
src/backend/optimizer/prep/prepjointree.c | 10 ++++++----
src/backend/rewrite/rewriteHandler.c | 7 ++++---
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index a61082d27c..cbeb0191fb 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -1500,8 +1500,9 @@ convert_EXISTS_sublink_to_join(PlannerInfo *root, SubLink *sublink,
* Add subquery's RTEPermissionInfos into the upper query. This also
* updates the subquery's RTEs' perminfoindex.
*/
- ConcatRTEPermissionInfoLists(&parse->rtepermlist, subselect->rtepermlist,
- subselect->rtable);
+ parse->rtepermlist = ConcatRTEPermissionInfoLists(parse->rtepermlist,
+ subselect->rtepermlist,
+ subselect->rtable);
/* Now we can attach the modified subquery rtable to the parent */
parse->rtable = list_concat(parse->rtable, subselect->rtable);
diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c
index b2ab2c14a4..8d7b243b21 100644
--- a/src/backend/optimizer/prep/prepjointree.c
+++ b/src/backend/optimizer/prep/prepjointree.c
@@ -1201,8 +1201,9 @@ pull_up_simple_subquery(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte,
* Add subquery's RTEPermissionInfos into the upper query. This also
* updates the subquery's RTEs' perminfoindex.
*/
- ConcatRTEPermissionInfoLists(&parse->rtepermlist, subquery->rtepermlist,
- subquery->rtable);
+ parse->rtepermlist = ConcatRTEPermissionInfoLists(parse->rtepermlist,
+ subquery->rtepermlist,
+ subquery->rtable);
/*
* Now append the adjusted rtable entries to upper query. (We hold off
@@ -1348,8 +1349,9 @@ pull_up_simple_union_all(PlannerInfo *root, Node *jtnode, RangeTblEntry *rte)
* Add subquery's RTEPermissionInfos into the upper query. This also
* updates the subquery's RTEs' perminfoindex.
*/
- ConcatRTEPermissionInfoLists(&root->parse->rtepermlist,
- subquery->rtepermlist, rtable);
+ root->parse->rtepermlist = ConcatRTEPermissionInfoLists(root->parse->rtepermlist,
+ subquery->rtepermlist,
+ rtable);
/*
* Append child RTEs to parent rtable.
*/
diff --git a/src/backend/rewrite/rewriteHandler.c b/src/backend/rewrite/rewriteHandler.c
index fda0eacf79..656a27ea22 100644
--- a/src/backend/rewrite/rewriteHandler.c
+++ b/src/backend/rewrite/rewriteHandler.c
@@ -420,10 +420,11 @@ rewriteRuleAction(Query *parsetree,
* for both. Copy rtable before calling ConcatRTEPermissionInfoLists(),
* because perminfoindex of those RTEs will be updated there.
*/
- sub_action->rtepermlist = copyObject(sub_action->rtepermlist);
query_rtable = copyObject(parsetree->rtable);
- ConcatRTEPermissionInfoLists(&sub_action->rtepermlist,
- parsetree->rtepermlist, query_rtable);
+ sub_action->rtepermlist =
+ ConcatRTEPermissionInfoLists(copyObject(sub_action->rtepermlist),
+ parsetree->rtepermlist,
+ query_rtable);
sub_action->rtable = list_concat(query_rtable, sub_action->rtable);
/*
--
2.30.2
--3sqhherzatux5zde
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="v25-0005-lfirst-lfirst_node.patch"
view thread (3+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH v25 4/9] change ConcatRTEPermissionInfoLists API
In-Reply-To: <no-message-id-635622@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox