aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2015-03-01 15:27:06 -0500
committerStephen Frost <sfrost@snowman.net>2015-03-01 15:27:40 -0500
commit99ccda339acc165d0bdfba34a62fe87cbe6f4068 (patch)
tree5ba146d531220f3a0b24a512fdd3420df6242ecc /src
parent22dd465d34f55b5a5b1790a5b5582fef9558d84b (diff)
downloadpostgresql-99ccda339acc165d0bdfba34a62fe87cbe6f4068.tar.gz
postgresql-99ccda339acc165d0bdfba34a62fe87cbe6f4068.zip
Fix targetRelation initializiation in prepsecurity
In 6f9bd50eabb0a4960e94c83dac8855771c9f340d, 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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/prep/prepsecurity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/prep/prepsecurity.c b/src/backend/optimizer/prep/prepsecurity.c
index 5206f9c0905..c47b349fd40 100644
--- a/src/backend/optimizer/prep/prepsecurity.c
+++ b/src/backend/optimizer/prep/prepsecurity.c
@@ -63,7 +63,6 @@ expand_security_quals(PlannerInfo *root, List *tlist)
Query *parse = root->parse;
int rt_index;
ListCell *cell;
- bool targetRelation = false;
/*
* Process each RTE in the rtable list.
@@ -74,7 +73,8 @@ expand_security_quals(PlannerInfo *root, List *tlist)
rt_index = 0;
foreach(cell, parse->rtable)
{
- RangeTblEntry *rte = (RangeTblEntry *) lfirst(cell);
+ bool targetRelation = false;
+ RangeTblEntry *rte = (RangeTblEntry *) lfirst(cell);
rt_index++;