aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeHashjoin.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-07-07 11:23:40 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-07-07 11:23:40 -0400
commit88210542106de5b26fe6aa088d1811b68502d224 (patch)
tree8a77c331d7a9b3995ac0e0323803bb5e112f4e91 /src/backend/executor/nodeHashjoin.c
parent62c46eee2279eb0300ab7ffe393d0d0dcfafb157 (diff)
downloadpostgresql-88210542106de5b26fe6aa088d1811b68502d224.tar.gz
postgresql-88210542106de5b26fe6aa088d1811b68502d224.zip
Remove stray references to lefttree/righttree in the executor.
The general convention in the executor is to refer to child plans and planstates via the outerPlan[State] and innerPlan[State] macros, but a few places didn't do it like that. For consistency and readability, convert all the stragglers to use the macros. (See also commit 40f42d2a3, which did some similar cleanup a few years ago, but missed these cases.) Richard Guo Discussion: https://postgr.es/m/CAMbWs4-vYhh1xsa_veah4PUed2Xq=Ed_YH3=Mqt5A3Y=EgfCEg@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeHashjoin.c')
-rw-r--r--src/backend/executor/nodeHashjoin.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 88b870655e9..87403e24781 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -1290,6 +1290,9 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
void
ExecReScanHashJoin(HashJoinState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+ PlanState *innerPlan = innerPlanState(node);
+
/*
* In a multi-batch join, we currently have to do rescans the hard way,
* primarily because batch temp files may have already been released. But
@@ -1300,7 +1303,7 @@ ExecReScanHashJoin(HashJoinState *node)
if (node->hj_HashTable != NULL)
{
if (node->hj_HashTable->nbatch == 1 &&
- node->js.ps.righttree->chgParam == NULL)
+ innerPlan->chgParam == NULL)
{
/*
* Okay to reuse the hash table; needn't rescan inner, either.
@@ -1328,7 +1331,7 @@ ExecReScanHashJoin(HashJoinState *node)
else
{
/* must destroy and rebuild hash table */
- HashState *hashNode = castNode(HashState, innerPlanState(node));
+ HashState *hashNode = castNode(HashState, innerPlan);
Assert(hashNode->hashtable == node->hj_HashTable);
/* accumulate stats from old hash table, if wanted */
@@ -1350,8 +1353,8 @@ ExecReScanHashJoin(HashJoinState *node)
* if chgParam of subnode is not null then plan will be re-scanned
* by first ExecProcNode.
*/
- if (node->js.ps.righttree->chgParam == NULL)
- ExecReScan(node->js.ps.righttree);
+ if (innerPlan->chgParam == NULL)
+ ExecReScan(innerPlan);
}
}
@@ -1368,8 +1371,8 @@ ExecReScanHashJoin(HashJoinState *node)
* if chgParam of subnode is not null then plan will be re-scanned by
* first ExecProcNode.
*/
- if (node->js.ps.lefttree->chgParam == NULL)
- ExecReScan(node->js.ps.lefttree);
+ if (outerPlan->chgParam == NULL)
+ ExecReScan(outerPlan);
}
void