Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite8d78d3

Browse files
committed
ExecAgg() failed to finish running out set-returning functions in the last
aggregated tuple of a run. Per report from Laurenz Albe. This is a newbug in 8.4, but only because prior versions rejected SRFs in an Agg plannode altogether.
1 parent5126826 commite8d78d3

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎src/backend/executor/nodeAgg.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* Portions Copyright (c) 1994, Regents of the University of California
6262
*
6363
* IDENTIFICATION
64-
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.166 2009/04/02 20:59:10 momjian Exp $
64+
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.167 2009/06/17 16:05:34 tgl Exp $
6565
*
6666
*-------------------------------------------------------------------------
6767
*/
@@ -811,9 +811,6 @@ lookup_hash_entry(AggState *aggstate, TupleTableSlot *inputslot)
811811
TupleTableSlot*
812812
ExecAgg(AggState*node)
813813
{
814-
if (node->agg_done)
815-
returnNULL;
816-
817814
/*
818815
* Check to see if we're still projecting out tuples from a previous agg
819816
* tuple (because there is a function-returning-set in the projection
@@ -831,6 +828,15 @@ ExecAgg(AggState *node)
831828
node->ss.ps.ps_TupFromTlist= false;
832829
}
833830

831+
/*
832+
* Exit if nothing left to do. (We must do the ps_TupFromTlist check
833+
* first, because in some cases agg_done gets set before we emit the
834+
* final aggregate tuple, and we have to finish running SRFs for it.)
835+
*/
836+
if (node->agg_done)
837+
returnNULL;
838+
839+
/* Dispatch based on strategy */
834840
if (((Agg*)node->ss.ps.plan)->aggstrategy==AGG_HASHED)
835841
{
836842
if (!node->table_filled)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp