diff options
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/copyto.c | 5 | ||||
-rw-r--r-- | src/backend/commands/createas.c | 5 | ||||
-rw-r--r-- | src/backend/commands/explain.c | 22 | ||||
-rw-r--r-- | src/backend/commands/extension.c | 4 | ||||
-rw-r--r-- | src/backend/commands/matview.c | 5 | ||||
-rw-r--r-- | src/backend/commands/portalcmds.c | 1 | ||||
-rw-r--r-- | src/backend/commands/prepare.c | 9 | ||||
-rw-r--r-- | src/backend/commands/trigger.c | 15 |
8 files changed, 14 insertions, 52 deletions
diff --git a/src/backend/commands/copyto.c b/src/backend/commands/copyto.c index f87e405351d..ea6f18f2c80 100644 --- a/src/backend/commands/copyto.c +++ b/src/backend/commands/copyto.c @@ -835,7 +835,7 @@ BeginCopyTo(ParseState *pstate, ((DR_copy *) dest)->cstate = cstate; /* Create a QueryDesc requesting no output */ - cstate->queryDesc = CreateQueryDesc(plan, NULL, pstate->p_sourcetext, + cstate->queryDesc = CreateQueryDesc(plan, pstate->p_sourcetext, GetActiveSnapshot(), InvalidSnapshot, dest, NULL, NULL, 0); @@ -845,8 +845,7 @@ BeginCopyTo(ParseState *pstate, * * ExecutorStart computes a result tupdesc for us */ - if (!ExecutorStart(cstate->queryDesc, 0)) - elog(ERROR, "ExecutorStart() failed unexpectedly"); + ExecutorStart(cstate->queryDesc, 0); tupDesc = cstate->queryDesc->tupDesc; } diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c index 0a4155773eb..dfd2ab8e862 100644 --- a/src/backend/commands/createas.c +++ b/src/backend/commands/createas.c @@ -334,13 +334,12 @@ ExecCreateTableAs(ParseState *pstate, CreateTableAsStmt *stmt, UpdateActiveSnapshotCommandId(); /* Create a QueryDesc, redirecting output to our tuple receiver */ - queryDesc = CreateQueryDesc(plan, NULL, pstate->p_sourcetext, + queryDesc = CreateQueryDesc(plan, pstate->p_sourcetext, GetActiveSnapshot(), InvalidSnapshot, dest, params, queryEnv, 0); /* call ExecutorStart to prepare the plan for execution */ - if (!ExecutorStart(queryDesc, GetIntoRelEFlags(into))) - elog(ERROR, "ExecutorStart() failed unexpectedly"); + ExecutorStart(queryDesc, GetIntoRelEFlags(into)); /* run the plan to completion */ ExecutorRun(queryDesc, ForwardScanDirection, 0); diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 786ee865f14..09ea30dfb92 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -369,8 +369,7 @@ standard_ExplainOneQuery(Query *query, int cursorOptions, } /* run it (if needed) and produce output */ - ExplainOnePlan(plan, NULL, NULL, -1, into, es, queryString, params, - queryEnv, + ExplainOnePlan(plan, into, es, queryString, params, queryEnv, &planduration, (es->buffers ? &bufusage : NULL), es->memory ? &mem_counters : NULL); } @@ -492,9 +491,7 @@ ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es, * to call it. */ void -ExplainOnePlan(PlannedStmt *plannedstmt, CachedPlan *cplan, - CachedPlanSource *plansource, int query_index, - IntoClause *into, ExplainState *es, +ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv, const instr_time *planduration, const BufferUsage *bufusage, @@ -550,7 +547,7 @@ ExplainOnePlan(PlannedStmt *plannedstmt, CachedPlan *cplan, dest = None_Receiver; /* Create a QueryDesc for the query */ - queryDesc = CreateQueryDesc(plannedstmt, cplan, queryString, + queryDesc = CreateQueryDesc(plannedstmt, queryString, GetActiveSnapshot(), InvalidSnapshot, dest, params, queryEnv, instrument_option); @@ -564,17 +561,8 @@ ExplainOnePlan(PlannedStmt *plannedstmt, CachedPlan *cplan, if (into) eflags |= GetIntoRelEFlags(into); - /* Prepare the plan for execution. */ - if (queryDesc->cplan) - { - ExecutorStartCachedPlan(queryDesc, eflags, plansource, query_index); - Assert(queryDesc->planstate); - } - else - { - if (!ExecutorStart(queryDesc, eflags)) - elog(ERROR, "ExecutorStart() failed unexpectedly"); - } + /* call ExecutorStart to prepare the plan for execution */ + ExecutorStart(queryDesc, eflags); /* Execute the plan for statistics if asked for */ if (es->analyze) diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 73c52e970f6..e6f9ab6dfd6 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -993,13 +993,11 @@ execute_sql_string(const char *sql, const char *filename) QueryDesc *qdesc; qdesc = CreateQueryDesc(stmt, - NULL, sql, GetActiveSnapshot(), NULL, dest, NULL, NULL, 0); - if (!ExecutorStart(qdesc, 0)) - elog(ERROR, "ExecutorStart() failed unexpectedly"); + ExecutorStart(qdesc, 0); ExecutorRun(qdesc, ForwardScanDirection, 0); ExecutorFinish(qdesc); ExecutorEnd(qdesc); diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index e7854add178..27c2cb26ef5 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -438,13 +438,12 @@ refresh_matview_datafill(DestReceiver *dest, Query *query, UpdateActiveSnapshotCommandId(); /* Create a QueryDesc, redirecting output to our tuple receiver */ - queryDesc = CreateQueryDesc(plan, NULL, queryString, + queryDesc = CreateQueryDesc(plan, queryString, GetActiveSnapshot(), InvalidSnapshot, dest, NULL, NULL, 0); /* call ExecutorStart to prepare the plan for execution */ - if (!ExecutorStart(queryDesc, 0)) - elog(ERROR, "ExecutorStart() failed unexpectedly"); + ExecutorStart(queryDesc, 0); /* run the plan */ ExecutorRun(queryDesc, ForwardScanDirection, 0); diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 4c2ac045224..e7c8171c102 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -117,7 +117,6 @@ PerformCursorOpen(ParseState *pstate, DeclareCursorStmt *cstmt, ParamListInfo pa queryString, CMDTAG_SELECT, /* cursor's query is always a SELECT */ list_make1(plan), - NULL, NULL); /*---------- diff --git a/src/backend/commands/prepare.c b/src/backend/commands/prepare.c index bf7d2b2309f..34b6410d6a2 100644 --- a/src/backend/commands/prepare.c +++ b/src/backend/commands/prepare.c @@ -205,8 +205,7 @@ ExecuteQuery(ParseState *pstate, query_string, entry->plansource->commandTag, plan_list, - cplan, - entry->plansource); + cplan); /* * For CREATE TABLE ... AS EXECUTE, we must verify that the prepared @@ -586,7 +585,6 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, MemoryContextCounters mem_counters; MemoryContext planner_ctx = NULL; MemoryContext saved_ctx = NULL; - int query_index = 0; if (es->memory) { @@ -659,8 +657,7 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, PlannedStmt *pstmt = lfirst_node(PlannedStmt, p); if (pstmt->commandType != CMD_UTILITY) - ExplainOnePlan(pstmt, cplan, entry->plansource, query_index, - into, es, query_string, paramLI, pstate->p_queryEnv, + ExplainOnePlan(pstmt, into, es, query_string, paramLI, pstate->p_queryEnv, &planduration, (es->buffers ? &bufusage : NULL), es->memory ? &mem_counters : NULL); else @@ -671,8 +668,6 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es, /* Separate plans with an appropriate separator */ if (lnext(plan_list, p) != NULL) ExplainSeparatePlans(es); - - query_index++; } if (estate) diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index c9f61130c69..67f8e70f9c1 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -5058,21 +5058,6 @@ AfterTriggerBeginQuery(void) /* ---------- - * AfterTriggerAbortQuery() - * - * Called by standard_ExecutorEnd() if the query execution was aborted due to - * the plan becoming invalid during initialization. - * ---------- - */ -void -AfterTriggerAbortQuery(void) -{ - /* Revert the actions of AfterTriggerBeginQuery(). */ - afterTriggers.query_depth--; -} - - -/* ---------- * AfterTriggerEndQuery() * * Called after one query has been completely processed. At this time |