Skip to content
Snippets Groups Projects
Commit 7028c135 authored by Tom Lane's avatar Tom Lane
Browse files

Fix an oversight in two different recent patches: nodes that support SRFs

in their targetlists had better reset ps_TupFromTlist during ReScan calls.
There's no need to back-patch here since nodeAgg and nodeGroup didn't
even pretend to support SRFs in prior releases.
parent d5789018
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.162 2008/10/16 19:25:55 neilc Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.163 2008/10/23 15:29:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -1284,6 +1284,8 @@ ExecInitAgg(Agg *node, EState *estate, int eflags)
ExecAssignResultTypeFromTL(&aggstate->ss.ps);
ExecAssignProjectionInfo(&aggstate->ss.ps, NULL);
aggstate->ss.ps.ps_TupFromTlist = false;
/*
* get the count of aggregates in targetlist and quals
*/
......@@ -1647,6 +1649,8 @@ ExecReScanAgg(AggState *node, ExprContext *exprCtxt)
node->agg_done = false;
node->ss.ps.ps_TupFromTlist = false;
if (((Agg *) node->ss.ps.plan)->aggstrategy == AGG_HASHED)
{
/*
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeCtescan.c,v 1.1 2008/10/04 21:56:53 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeCtescan.c,v 1.2 2008/10/23 15:29:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -303,11 +303,10 @@ ExecEndCteScan(CteScanState *node)
void
ExecCteScanReScan(CteScanState *node, ExprContext *exprCtxt)
{
Tuplestorestate *tuplestorestate;
tuplestorestate = node->leader->cte_table;
Tuplestorestate *tuplestorestate = node->leader->cte_table;
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
node->ss.ps.ps_TupFromTlist = false;
if (node->leader == node)
{
......
......@@ -15,7 +15,7 @@
* locate group boundaries.
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeGroup.c,v 1.71 2008/09/08 00:22:56 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeGroup.c,v 1.72 2008/10/23 15:29:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -247,6 +247,8 @@ ExecInitGroup(Group *node, EState *estate, int eflags)
ExecAssignResultTypeFromTL(&grpstate->ss.ps);
ExecAssignProjectionInfo(&grpstate->ss.ps, NULL);
grpstate->ss.ps.ps_TupFromTlist = false;
/*
* Precompute fmgr lookup data for inner loop
*/
......@@ -286,6 +288,7 @@ void
ExecReScanGroup(GroupState *node, ExprContext *exprCtxt)
{
node->grp_done = FALSE;
node->ss.ps.ps_TupFromTlist = false;
/* must clear first tuple */
ExecClearTuple(node->ss.ss_ScanTupleSlot);
......
......@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeWorktablescan.c,v 1.2 2008/10/13 00:41:40 tgl Exp $
* $PostgreSQL: pgsql/src/backend/executor/nodeWorktablescan.c,v 1.3 2008/10/23 15:29:23 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -204,6 +204,8 @@ void
ExecWorkTableScanReScan(WorkTableScanState *node, ExprContext *exprCtxt)
{
ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
node->ss.ps.ps_TupFromTlist = false;
/* No need (or way) to rescan if ExecWorkTableScan not called yet */
if (node->rustate)
tuplestore_rescan(node->rustate->working_table);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment