1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-19 23:22:23 +03:00

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
This commit is contained in:
Tom Lane
2022-07-07 11:23:40 -04:00
parent 62c46eee22
commit 8821054210
14 changed files with 56 additions and 37 deletions

View File

@@ -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);
}