diff options
Diffstat (limited to 'src/backend/executor')
-rw-r--r-- | src/backend/executor/execTuples.c | 17 | ||||
-rw-r--r-- | src/backend/executor/nodeAgg.c | 22 |
2 files changed, 16 insertions, 23 deletions
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c index 1a5f835be1d..7b0df664c74 100644 --- a/src/backend/executor/execTuples.c +++ b/src/backend/executor/execTuples.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.59 2002/09/04 20:31:17 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.60 2002/09/28 20:00:19 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -560,23 +560,14 @@ ExecInitNullTupleSlot(EState *estate, TupleDesc tupType) TupleDesc ExecTypeFromTL(List *targetList, bool hasoid) { - List *tlitem; TupleDesc typeInfo; - Resdom *resdom; - Oid restype; + List *tlitem; int len; /* - * examine targetlist - if empty then return NULL - */ - len = ExecTargetListLength(targetList); - - if (len == 0) - return NULL; - - /* * allocate a new typeInfo */ + len = ExecTargetListLength(targetList); typeInfo = CreateTemplateTupleDesc(len, hasoid); /* @@ -585,6 +576,8 @@ ExecTypeFromTL(List *targetList, bool hasoid) foreach(tlitem, targetList) { TargetEntry *tle = lfirst(tlitem); + Resdom *resdom; + Oid restype; if (tle->resdom != NULL) { 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); } } } |