aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeGroup.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>1999-07-11 01:57:32 +0000
committerTom Lane <tgl@sss.pgh.pa.us>1999-07-11 01:57:32 +0000
commit9cbd349bcd00494a367cd42fbfbbdd1f625762a6 (patch)
tree3c3fe70f97fb4ee2aabd291ca471eb2a8adb9c6f /src/backend/executor/nodeGroup.c
parentebc3cc7efa6fe9e795da9a777211cc9fb9bc5a26 (diff)
downloadpostgresql-9cbd349bcd00494a367cd42fbfbbdd1f625762a6.tar.gz
postgresql-9cbd349bcd00494a367cd42fbfbbdd1f625762a6.zip
ExecReScanGroup() forgot to clear grpstate->grp_firstTuple,
thereby guaranteeing wrong results from a rescanned Group node.
Diffstat (limited to 'src/backend/executor/nodeGroup.c')
-rw-r--r--src/backend/executor/nodeGroup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/executor/nodeGroup.c b/src/backend/executor/nodeGroup.c
index 55659a90254..c5cb1d35234 100644
--- a/src/backend/executor/nodeGroup.c
+++ b/src/backend/executor/nodeGroup.c
@@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.26 1999/05/25 16:08:41 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.27 1999/07/11 01:57:32 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -271,6 +271,7 @@ ExecInitGroup(Group *node, EState *estate, Plan *parent)
node->grpstate = grpstate;
grpstate->grp_useFirstTuple = FALSE;
grpstate->grp_done = FALSE;
+ grpstate->grp_firstTuple = NULL;
/*
* assign node's base id and create expression context
@@ -423,6 +424,11 @@ ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent)
grpstate->grp_useFirstTuple = FALSE;
grpstate->grp_done = FALSE;
+ if (grpstate->grp_firstTuple != NULL)
+ {
+ pfree(grpstate->grp_firstTuple);
+ grpstate->grp_firstTuple = NULL;
+ }
if (((Plan *) node)->lefttree &&
((Plan *) node)->lefttree->chgParam == NULL)