Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c60ecd8

Browse files
committed
Ooops ... 6.5 coding wasn't quite right anymore. Should learn
never to commit without running regress tests...
1 parent b021e9a commit c60ecd8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/backend/executor/nodeAgg.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* SQL aggregates. (Do not expect POSTQUEL semantics.) -- ay 2/95
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.58 1999/10/30 01:18:16 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.59 1999/10/30 02:35:14 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -434,11 +434,15 @@ ExecAgg(Agg *node)
434434

435435
tupType = aggstate->csstate.css_ScanTupleSlot->ttc_tupleDescriptor;
436436
tupValue = projInfo->pi_tupValue;
437-
null_array = (char *) palloc(sizeof(char) * tupType->natts);
438-
for (attnum = 0; attnum < tupType->natts; attnum++)
439-
null_array[attnum] = 'n';
440-
inputTuple = heap_formtuple(tupType, tupValue, null_array);
441-
pfree(null_array);
437+
/* watch out for null input tuples, though... */
438+
if (tupType && tupValue)
439+
{
440+
null_array = (char *) palloc(sizeof(char)*tupType->natts);
441+
for (attnum = 0; attnum < tupType->natts; attnum++)
442+
null_array[attnum] = 'n';
443+
inputTuple = heap_formtuple(tupType, tupValue, null_array);
444+
pfree(null_array);
445+
}
442446
}
443447
}
444448

0 commit comments

Comments
 (0)