ExecReScanAgg(AggState *node)
{
ExprContext *econtext = node->ss.ps.ps_ExprContext;
+ PlanState *outerPlan = outerPlanState(node);
int aggno;
node->agg_done = false;
* 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;
* 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);
}
void
ExecReScanBitmapHeapScan(BitmapHeapScanState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+
/* rescan to release any page pin */
heap_rescan(node->ss.ss_currentScanDesc, NULL);
* 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);
}
/* ----------------------------------------------------------------
void
ExecReScanGroup(GroupState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+
node->grp_done = FALSE;
node->ss.ps.ps_TupFromTlist = false;
/* must clear first tuple */
* if chgParam of subnode is not null then plan will be re-scanned by
* first ExecProcNode.
*/
- if (node->ss.ps.lefttree &&
- node->ss.ps.lefttree->chgParam == NULL)
- ExecReScan(node->ss.ps.lefttree);
+ if (outerPlan->chgParam == NULL)
+ ExecReScan(outerPlan);
}
void
ExecReScanMaterial(MaterialState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
if (node->eflags != 0)
* 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
* 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;
}
}
void
ExecReScanSort(SortState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
+
/*
* If we haven't sorted yet, just return. If outerplan's chgParam is not
* NULL then it will be re-scanned by ExecProcNode, else no reason to
*
* Otherwise we can just rewind and rescan the sorted output.
*/
- if (node->ss.ps.lefttree->chgParam != NULL ||
+ if (outerPlan->chgParam != NULL ||
node->bounded != node->bounded_Done ||
node->bound != node->bound_Done ||
!node->randomAccess)
* 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);
}
else
tuplesort_rescan((Tuplesortstate *) node->tuplesortstate);
void
ExecReScanWindowAgg(WindowAggState *node)
{
+ PlanState *outerPlan = outerPlanState(node);
ExprContext *econtext = node->ss.ps.ps_ExprContext;
node->all_done = false;
* 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);
}
/*