diff options
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r-- | src/backend/executor/execUtils.c | 49 |
1 files changed, 7 insertions, 42 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index d188a38489d..493df3ef9ac 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -8,14 +8,13 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.146 2007/02/22 22:00:22 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.147 2007/02/27 01:11:25 tgl Exp $ * *------------------------------------------------------------------------- */ /* * INTERFACE ROUTINES * CreateExecutorState Create/delete executor working state - * CreateSubExecutorState * FreeExecutorState * CreateExprContext * CreateStandaloneExprContext @@ -66,8 +65,6 @@ int NIndexTupleInserted; int NIndexTupleProcessed; -static EState *InternalCreateExecutorState(MemoryContext qcontext, - bool is_subquery); static void ShutdownExprContext(ExprContext *econtext); @@ -152,7 +149,9 @@ DisplayTupleCount(FILE *statfp) EState * CreateExecutorState(void) { + EState *estate; MemoryContext qcontext; + MemoryContext oldcontext; /* * Create the per-query context for this Executor run. @@ -163,37 +162,6 @@ CreateExecutorState(void) ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE); - return InternalCreateExecutorState(qcontext, false); -} - -/* ---------------- - * CreateSubExecutorState - * - * Create and initialize an EState node for a sub-query. - * - * Ideally, sub-queries probably shouldn't have their own EState at all, - * but right now this is necessary because they have their own rangetables - * and we access the rangetable via the EState. It is critical that a - * sub-query share the parent's es_query_cxt, else structures allocated by - * the sub-query (especially its result tuple descriptor) may disappear - * too soon during executor shutdown. - * ---------------- - */ -EState * -CreateSubExecutorState(EState *parent_estate) -{ - return InternalCreateExecutorState(parent_estate->es_query_cxt, true); -} - -/* - * Guts of CreateExecutorState/CreateSubExecutorState - */ -static EState * -InternalCreateExecutorState(MemoryContext qcontext, bool is_subquery) -{ - EState *estate; - MemoryContext oldcontext; - /* * Make the EState node within the per-query context. This way, we don't * need a separate pfree() operation for it at shutdown. @@ -232,14 +200,14 @@ InternalCreateExecutorState(MemoryContext qcontext, bool is_subquery) estate->es_lastoid = InvalidOid; estate->es_rowMarks = NIL; - estate->es_is_subquery = is_subquery; - estate->es_instrument = false; estate->es_select_into = false; estate->es_into_oids = false; estate->es_exprcontexts = NIL; + estate->es_subplanstates = NIL; + estate->es_per_tuple_exprcontext = NULL; estate->es_plannedstmt = NULL; @@ -292,12 +260,9 @@ FreeExecutorState(EState *estate) /* * Free the per-query memory context, thereby releasing all working - * memory, including the EState node itself. In a subquery, we don't - * do this, leaving the memory cleanup to happen when the topmost query - * is closed down. + * memory, including the EState node itself. */ - if (!estate->es_is_subquery) - MemoryContextDelete(estate->es_query_cxt); + MemoryContextDelete(estate->es_query_cxt); } /* ---------------- |