|
11 | 11 | * SQL aggregates. (Do not expect POSTQUEL semantics.) -- ay 2/95 |
12 | 12 | * |
13 | 13 | * IDENTIFICATION |
14 | | - * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.58 1999/10/3001:18:16 tgl Exp $ |
| 14 | + * $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.59 1999/10/3002:35:14 tgl Exp $ |
15 | 15 | * |
16 | 16 | *------------------------------------------------------------------------- |
17 | 17 | */ |
@@ -434,11 +434,15 @@ ExecAgg(Agg *node) |
434 | 434 |
|
435 | 435 | tupType=aggstate->csstate.css_ScanTupleSlot->ttc_tupleDescriptor; |
436 | 436 | 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 | +} |
442 | 446 | } |
443 | 447 | } |
444 | 448 |
|
|