aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeSetOp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeSetOp.c')
-rw-r--r--src/backend/executor/nodeSetOp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/executor/nodeSetOp.c b/src/backend/executor/nodeSetOp.c
index 4b428cfa39f..8af12f96e72 100644
--- a/src/backend/executor/nodeSetOp.c
+++ b/src/backend/executor/nodeSetOp.c
@@ -597,6 +597,8 @@ ExecEndSetOp(SetOpState *node)
void
ExecReScanSetOp(SetOpState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+
ExecClearTuple(node->ps.ps_ResultTupleSlot);
node->setop_done = false;
node->numOutput = 0;
@@ -617,7 +619,7 @@ ExecReScanSetOp(SetOpState *node)
* parameter changes, then we can just rescan the existing hash table;
* no need to build it again.
*/
- if (node->ps.lefttree->chgParam == NULL)
+ if (outerPlan->chgParam == NULL)
{
ResetTupleHashIterator(node->hashtable, &node->hashiter);
return;
@@ -646,6 +648,6 @@ ExecReScanSetOp(SetOpState *node)
* if chgParam of subnode is not null then plan will be re-scanned by
* first ExecProcNode.
*/
- if (node->ps.lefttree->chgParam == NULL)
- ExecReScan(node->ps.lefttree);
+ if (outerPlan->chgParam == NULL)
+ ExecReScan(outerPlan);
}