diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-06-20 18:45:28 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-06-20 18:45:28 +0000 |
commit | 82480e28f5744582dba78320824e3569ed76e74a (patch) | |
tree | f3d6aea7799b512660fa16e3a41d4187125d20f7 /src/backend/executor/nodeWindowAgg.c | |
parent | 87698ffa8e667f99a224420db97aa0306d71b3f4 (diff) | |
download | postgresql-82480e28f5744582dba78320824e3569ed76e74a.tar.gz postgresql-82480e28f5744582dba78320824e3569ed76e74a.zip |
Fix things so that array_agg_finalfn does not modify or free its input
ArrayBuildState, per trouble report from Merlin Moncure. By adopting
this fix, we are essentially deciding that aggregate final-functions
should not modify their inputs ever. Adjust documentation and comments
to match that conclusion.
Diffstat (limited to 'src/backend/executor/nodeWindowAgg.c')
-rw-r--r-- | src/backend/executor/nodeWindowAgg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 0d9eb21a919..7343cb3752e 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -27,7 +27,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.5 2009/06/11 14:48:57 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeWindowAgg.c,v 1.6 2009/06/20 18:45:28 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -410,9 +410,8 @@ eval_windowaggregates(WindowAggState *winstate) * need the current aggregate value. This is considerably more efficient * than the naive approach of re-running the entire aggregate calculation * for each current row. It does assume that the final function doesn't - * damage the running transition value. (Some C-coded aggregates do that - * for efficiency's sake --- but they are supposed to do so only when - * their fcinfo->context is an AggState, not a WindowAggState.) + * damage the running transition value, but we have the same assumption + * in nodeAgg.c too (when it rescans an existing hash table). * * In many common cases, multiple rows share the same frame and hence the * same aggregate value. (In particular, if there's no ORDER BY in a RANGE |