summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2018-01-11 17:16:18 +0000
committerTom Lane2018-01-11 17:16:18 +0000
commit4d41b2e0926548e338d20875729a55d41289f867 (patch)
treedef0e673c61bd6ed36fa75601f454101c7472048
parent9ff4f758ee430dbce0be13ab5da315be52cb6f55 (diff)
Add QueryEnvironment to ExplainOneQuery_hook's parameter list.
This should have been done in commit 18ce3a4ab, which added that parameter to ExplainOneQuery, but it was overlooked. This makes it impossible for a user of the hook to pass the queryEnv down to ExplainOnePlan. It's too late to change this API in v10, I suppose, but fortunately passing NULL to ExplainOnePlan will work in nearly all interesting cases in v10. That might not be true forever, so we'd better fix it. Tatsuro Yamada, reviewed by Thomas Munro Discussion: https://postgr.es/m/[email protected]
-rw-r--r--src/backend/commands/explain.c2
-rw-r--r--src/include/commands/explain.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 79e6985d0d..41cd47e8bc 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -351,7 +351,7 @@ ExplainOneQuery(Query *query, int cursorOptions,
/* if an advisor plugin is present, let it manage things */
if (ExplainOneQuery_hook)
(*ExplainOneQuery_hook) (query, cursorOptions, into, es,
- queryString, params);
+ queryString, params, queryEnv);
else
{
PlannedStmt *plan;
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h
index dd8abae98a..0c3986ae17 100644
--- a/src/include/commands/explain.h
+++ b/src/include/commands/explain.h
@@ -53,7 +53,8 @@ typedef void (*ExplainOneQuery_hook_type) (Query *query,
IntoClause *into,
ExplainState *es,
const char *queryString,
- ParamListInfo params);
+ ParamListInfo params,
+ QueryEnvironment *queryEnv);
extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
/* Hook for plugins to get control in explain_get_index_name() */