diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 3bc78331e4..9c5d6e66a2 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -3570,6 +3570,11 @@ ExecInitAgg(Agg *node, EState *estate, int eflags) { int length = phasedata->gset_lengths[i]; + /* nothing to do for empty grouping set */ + if (length == 0) + continue; + + /* if we already had one of this length, it'll do */ if (phasedata->eqfunctions[length - 1] != NULL) continue;