diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-05-04 16:13:07 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-05-04 16:17:36 -0400 |
commit | 40f42d2a34329b0b71a1287d6fd2554298dbb713 (patch) | |
tree | fb9a2cf0acfd47b94a2ff72f1757fd978353f1f6 /src/backend/executor/nodeMaterial.c | |
parent | 2503982be4ca48f48d2bb6e1d46160b23e4bb268 (diff) | |
download | postgresql-40f42d2a34329b0b71a1287d6fd2554298dbb713.tar.gz postgresql-40f42d2a34329b0b71a1287d6fd2554298dbb713.zip |
Use outerPlanState macro instead of referring to leffttree.
This makes the executor code more consistent. It also removes
an apparently superfluous NULL test in nodeGroup.c.
Qingqing Zhou, reviewed by Tom Lane, and further revised by me.
Diffstat (limited to 'src/backend/executor/nodeMaterial.c')
-rw-r--r-- | src/backend/executor/nodeMaterial.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/executor/nodeMaterial.c b/src/backend/executor/nodeMaterial.c index 11588258694..8ff4352a66a 100644 --- a/src/backend/executor/nodeMaterial.c +++ b/src/backend/executor/nodeMaterial.c @@ -317,6 +317,8 @@ ExecMaterialRestrPos(MaterialState *node) void ExecReScanMaterial(MaterialState *node) { + PlanState *outerPlan = outerPlanState(node); + ExecClearTuple(node->ss.ps.ps_ResultTupleSlot); if (node->eflags != 0) @@ -339,13 +341,13 @@ ExecReScanMaterial(MaterialState *node) * Otherwise we can just rewind and rescan the stored output. The * state of the subnode does not change. */ - if (node->ss.ps.lefttree->chgParam != NULL || + if (outerPlan->chgParam != NULL || (node->eflags & EXEC_FLAG_REWIND) == 0) { tuplestore_end(node->tuplestorestate); node->tuplestorestate = NULL; - if (node->ss.ps.lefttree->chgParam == NULL) - ExecReScan(node->ss.ps.lefttree); + if (outerPlan->chgParam == NULL) + ExecReScan(outerPlan); node->eof_underlying = false; } else @@ -359,8 +361,8 @@ ExecReScanMaterial(MaterialState *node) * if chgParam of subnode is not null then plan will be re-scanned by * first ExecProcNode. */ - if (node->ss.ps.lefttree->chgParam == NULL) - ExecReScan(node->ss.ps.lefttree); + if (outerPlan->chgParam == NULL) + ExecReScan(outerPlan); node->eof_underlying = false; } } |