aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeAgg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r--src/backend/executor/nodeAgg.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c
index 444a5bc9db6..9778e365a58 100644
--- a/src/backend/executor/nodeAgg.c
+++ b/src/backend/executor/nodeAgg.c
@@ -676,3 +676,21 @@ aggGetAttr(TupleTableSlot *slot,
return result;
}
+
+void
+ExecReScanAgg(Agg *node, ExprContext *exprCtxt, Plan *parent)
+{
+ AggState *aggstate = node->aggstate;
+ ExprContext *econtext = aggstate->csstate.cstate.cs_ExprContext;
+
+ aggstate->agg_done = FALSE;
+ MemSet(econtext->ecxt_values, 0, sizeof(Datum) * length(node->aggs));
+ MemSet(econtext->ecxt_nulls, 0, length(node->aggs));
+ /*
+ * if chgParam of subnode is not null then plan
+ * will be re-scanned by first ExecProcNode.
+ */
+ if (((Plan*) node)->lefttree->chgParam == NULL)
+ ExecReScan (((Plan*) node)->lefttree, exprCtxt, (Plan *) node);
+
+}