diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-26 22:37:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-26 22:37:42 +0000 |
commit | 1dfbbd51e778c924b2958c69308adf02681d0801 (patch) | |
tree | 10d13621bb5732da8652a86a23f17677ee729e55 /src/backend/executor/nodeSubplan.c | |
parent | 061d4e207907392873825f4fbb2cebf076ae2d37 (diff) | |
download | postgresql-1dfbbd51e778c924b2958c69308adf02681d0801.tar.gz postgresql-1dfbbd51e778c924b2958c69308adf02681d0801.zip |
Don't try to free executor state of an InitPlan early --- this breaks
EXPLAIN ANALYZE. (Premature optimization is the root of all evil?)
Diffstat (limited to 'src/backend/executor/nodeSubplan.c')
-rw-r--r-- | src/backend/executor/nodeSubplan.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index 2f5ab52e213..5a6950e0bee 100644 --- a/src/backend/executor/nodeSubplan.c +++ b/src/backend/executor/nodeSubplan.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * 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); } @@ -502,6 +493,8 @@ ExecEndSubPlan(SubPlanState *node) ExecEndPlan(node->planstate, node->sub_estate); MemoryContextSwitchTo(oldcontext); FreeExecutorState(node->sub_estate); + node->sub_estate = NULL; + node->planstate = NULL; node->needShutdown = false; } if (node->curTuple) |