1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

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.
This commit is contained in:
Robert Haas
2015-05-04 16:13:07 -04:00
parent 2503982be4
commit 40f42d2a34
6 changed files with 27 additions and 18 deletions

View File

@ -2053,6 +2053,7 @@ void
ExecReScanAgg(AggState *node)
{
ExprContext *econtext = node->ss.ps.ps_ExprContext;
PlanState *outerPlan = outerPlanState(node);
int aggno;
node->agg_done = false;
@ -2075,7 +2076,7 @@ ExecReScanAgg(AggState *node)
* parameter changes, then we can just rescan the existing hash table;
* no need to build it again.
*/
if (node->ss.ps.lefttree->chgParam == NULL)
if (outerPlan->chgParam == NULL)
{
ResetTupleHashIterator(node->hashtable, &node->hashiter);
return;
@ -2133,8 +2134,8 @@ ExecReScanAgg(AggState *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);
}