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

Commit1dfbbd5

Browse files
committed
Don't try to free executor state of an InitPlan early --- this breaks
EXPLAIN ANALYZE. (Premature optimization is the root of all evil?)
1 parent061d4e2 commit1dfbbd5

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

‎src/backend/executor/nodeSubplan.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.39 2002/12/15 16:17:46 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.40 2002/12/26 22:37:42 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -475,15 +475,6 @@ ExecSetParamPlan(SubPlanState *node, ExprContext *econtext)
475475
}
476476
}
477477

478-
if (planstate->plan->extParam==NULL)/* un-correlated ... */
479-
{
480-
ExecEndPlan(planstate,node->sub_estate);
481-
/* mustn't free context while still in it... */
482-
MemoryContextSwitchTo(oldcontext);
483-
FreeExecutorState(node->sub_estate);
484-
node->needShutdown= false;
485-
}
486-
487478
MemoryContextSwitchTo(oldcontext);
488479
}
489480

@@ -502,6 +493,8 @@ ExecEndSubPlan(SubPlanState *node)
502493
ExecEndPlan(node->planstate,node->sub_estate);
503494
MemoryContextSwitchTo(oldcontext);
504495
FreeExecutorState(node->sub_estate);
496+
node->sub_estate=NULL;
497+
node->planstate=NULL;
505498
node->needShutdown= false;
506499
}
507500
if (node->curTuple)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp