Don't try to free executor state of an InitPlan early --- this breaks
EXPLAIN ANALYZE. (Premature optimization is the root of all evil?)
This commit is contained in:
parent
061d4e2079
commit
1dfbbd51e7
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.39 2002/12/15 16:17:46 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.40 2002/12/26 22:37:42 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -475,15 +475,6 @@ ExecSetParamPlan(SubPlanState *node, ExprContext *econtext)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (planstate->plan->extParam == NULL) /* un-correlated ... */
|
|
||||||
{
|
|
||||||
ExecEndPlan(planstate, node->sub_estate);
|
|
||||||
/* mustn't free context while still in it... */
|
|
||||||
MemoryContextSwitchTo(oldcontext);
|
|
||||||
FreeExecutorState(node->sub_estate);
|
|
||||||
node->needShutdown = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldcontext);
|
MemoryContextSwitchTo(oldcontext);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,6 +493,8 @@ ExecEndSubPlan(SubPlanState *node)
|
|||||||
ExecEndPlan(node->planstate, node->sub_estate);
|
ExecEndPlan(node->planstate, node->sub_estate);
|
||||||
MemoryContextSwitchTo(oldcontext);
|
MemoryContextSwitchTo(oldcontext);
|
||||||
FreeExecutorState(node->sub_estate);
|
FreeExecutorState(node->sub_estate);
|
||||||
|
node->sub_estate = NULL;
|
||||||
|
node->planstate = NULL;
|
||||||
node->needShutdown = false;
|
node->needShutdown = false;
|
||||||
}
|
}
|
||||||
if (node->curTuple)
|
if (node->curTuple)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user