Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 99ccda3

Browse files
committed
Fix targetRelation initializiation in prepsecurity
In 6f9bd50, we modified expand_security_quals() to tell expand_security_qual() about when the current RTE was the targetRelation. Unfortunately, that commit initialized the targetRelation variable used outside of the loop over the RTEs instead of at the start of it. This patch moves the variable and the initialization of it into the loop, where it should have been to begin with. Pointed out by Dean Rasheed. Back-patch to 9.4 as the original commit was.
1 parent 22dd465 commit 99ccda3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/optimizer/prep/prepsecurity.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ expand_security_quals(PlannerInfo *root, List *tlist)
6363
Query *parse = root->parse;
6464
int rt_index;
6565
ListCell *cell;
66-
bool targetRelation = false;
6766

6867
/*
6968
* Process each RTE in the rtable list.
@@ -74,7 +73,8 @@ expand_security_quals(PlannerInfo *root, List *tlist)
7473
rt_index = 0;
7574
foreach(cell, parse->rtable)
7675
{
77-
RangeTblEntry *rte = (RangeTblEntry *) lfirst(cell);
76+
bool targetRelation = false;
77+
RangeTblEntry *rte = (RangeTblEntry *) lfirst(cell);
7878

7979
rt_index++;
8080

0 commit comments

Comments
 (0)