|
61 | 61 | * Portions Copyright (c) 1994, Regents of the University of California |
62 | 62 | * |
63 | 63 | * IDENTIFICATION |
64 | | - * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.139 2006/04/04 19:35:34 tgl Exp $ |
| 64 | + * $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.140 2006/06/21 18:39:42 tgl Exp $ |
65 | 65 | * |
66 | 66 | *------------------------------------------------------------------------- |
67 | 67 | */ |
@@ -831,32 +831,12 @@ agg_retrieve_direct(AggState *aggstate) |
831 | 831 | &aggvalues[aggno],&aggnulls[aggno]); |
832 | 832 | } |
833 | 833 |
|
834 | | -/* |
835 | | - * If we have no first tuple (ie, the outerPlan didn't return |
836 | | - * anything), create a dummy all-nulls input tuple for use by |
837 | | - * ExecQual/ExecProject. 99.44% of the time this is a waste of cycles, |
838 | | - * because ordinarily the projected output tuple's targetlist cannot |
839 | | - * contain any direct (non-aggregated) references to input columns, so |
840 | | - * the dummy tuple will not be referenced. However there are special |
841 | | - * cases where this isn't so --- in particular an UPDATE involving an |
842 | | - * aggregate will have a targetlist reference to ctid.We need to |
843 | | - * return a null for ctid in that situation, not coredump. |
844 | | - * |
845 | | - * The values returned for the aggregates will be the initial values |
846 | | - * of the transition functions. |
847 | | - */ |
848 | | -if (TupIsNull(firstSlot)) |
849 | | -{ |
850 | | -/* Should only happen in non-grouped mode */ |
851 | | -Assert(node->aggstrategy==AGG_PLAIN); |
852 | | -Assert(aggstate->agg_done); |
853 | | - |
854 | | -ExecStoreAllNullTuple(firstSlot); |
855 | | -} |
856 | | - |
857 | 834 | /* |
858 | 835 | * Use the representative input tuple for any references to |
859 | | - * non-aggregated input columns in the qual and tlist. |
| 836 | + * non-aggregated input columns in the qual and tlist. (If we are |
| 837 | + * not grouping, and there are no input rows at all, we will come |
| 838 | + * here with an empty firstSlot ... but if not grouping, there can't |
| 839 | + * be any references to non-aggregated input columns, so no problem.) |
860 | 840 | */ |
861 | 841 | econtext->ecxt_scantuple=firstSlot; |
862 | 842 |
|
|