diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/auto_explain/auto_explain.c | 16 | ||||
-rw-r--r-- | contrib/pg_stat_statements/pg_stat_statements.c | 16 |
2 files changed, 8 insertions, 24 deletions
diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c index cd6625020a7..1f4badb4928 100644 --- a/contrib/auto_explain/auto_explain.c +++ b/contrib/auto_explain/auto_explain.c @@ -81,7 +81,7 @@ static ExecutorRun_hook_type prev_ExecutorRun = NULL; static ExecutorFinish_hook_type prev_ExecutorFinish = NULL; static ExecutorEnd_hook_type prev_ExecutorEnd = NULL; -static bool explain_ExecutorStart(QueryDesc *queryDesc, int eflags); +static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags); static void explain_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count); @@ -261,11 +261,9 @@ _PG_init(void) /* * ExecutorStart hook: start up logging if needed */ -static bool +static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags) { - bool plan_valid; - /* * At the beginning of each top-level statement, decide whether we'll * sample this statement. If nested-statement explaining is enabled, @@ -301,13 +299,9 @@ explain_ExecutorStart(QueryDesc *queryDesc, int eflags) } if (prev_ExecutorStart) - plan_valid = prev_ExecutorStart(queryDesc, eflags); + prev_ExecutorStart(queryDesc, eflags); else - plan_valid = standard_ExecutorStart(queryDesc, eflags); - - /* The plan may have become invalid during standard_ExecutorStart() */ - if (!plan_valid) - return false; + standard_ExecutorStart(queryDesc, eflags); if (auto_explain_enabled()) { @@ -325,8 +319,6 @@ explain_ExecutorStart(QueryDesc *queryDesc, int eflags) MemoryContextSwitchTo(oldcxt); } } - - return true; } /* diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 9778407cba3..d8fdf42df79 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -335,7 +335,7 @@ static PlannedStmt *pgss_planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams); -static bool pgss_ExecutorStart(QueryDesc *queryDesc, int eflags); +static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags); static void pgss_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count); @@ -989,19 +989,13 @@ pgss_planner(Query *parse, /* * ExecutorStart hook: start up tracking if needed */ -static bool +static void pgss_ExecutorStart(QueryDesc *queryDesc, int eflags) { - bool plan_valid; - if (prev_ExecutorStart) - plan_valid = prev_ExecutorStart(queryDesc, eflags); + prev_ExecutorStart(queryDesc, eflags); else - plan_valid = standard_ExecutorStart(queryDesc, eflags); - - /* The plan may have become invalid during standard_ExecutorStart() */ - if (!plan_valid) - return false; + standard_ExecutorStart(queryDesc, eflags); /* * If query has queryId zero, don't track it. This prevents double @@ -1024,8 +1018,6 @@ pgss_ExecutorStart(QueryDesc *queryDesc, int eflags) MemoryContextSwitchTo(oldcxt); } } - - return true; } /* |