diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 31609c60fc6..1fdfbd1eea7 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -3574,6 +3574,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;