diff options
Diffstat (limited to 'src/backend/executor/nodeAgg.c')
-rw-r--r-- | src/backend/executor/nodeAgg.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/executor/nodeAgg.c b/src/backend/executor/nodeAgg.c index 898ca62a600..0ebf2f7151e 100644 --- a/src/backend/executor/nodeAgg.c +++ b/src/backend/executor/nodeAgg.c @@ -46,7 +46,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.87 2002/09/18 21:35:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.88 2002/09/28 20:00:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -658,20 +658,20 @@ ExecAgg(Agg *node) if (inputTuple == NULL) { TupleDesc tupType; - Datum *tupValue; - char *null_array; - AttrNumber attnum; + Datum *dvalues; + char *dnulls; tupType = aggstate->csstate.css_ScanTupleSlot->ttc_tupleDescriptor; - tupValue = projInfo->pi_tupValue; /* watch out for null input tuples, though... */ - if (tupType && tupValue) + if (tupType && tupType->natts > 0) { - null_array = (char *) palloc(sizeof(char) * tupType->natts); - for (attnum = 0; attnum < tupType->natts; attnum++) - null_array[attnum] = 'n'; - inputTuple = heap_formtuple(tupType, tupValue, null_array); - pfree(null_array); + dvalues = (Datum *) palloc(sizeof(Datum) * tupType->natts); + dnulls = (char *) palloc(sizeof(char) * tupType->natts); + MemSet(dvalues, 0, sizeof(Datum) * tupType->natts); + MemSet(dnulls, 'n', sizeof(char) * tupType->natts); + inputTuple = heap_formtuple(tupType, dvalues, dnulls); + pfree(dvalues); + pfree(dnulls); } } } |