Skip to content

Commit 4d41b2e

Browse files
committed
Add QueryEnvironment to ExplainOneQuery_hook's parameter list.
This should have been done in commit 18ce3a4, 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/890e8dd9-c1c7-a422-6892-874f5eaee048@lab.ntt.co.jp
1 parent 9ff4f75 commit 4d41b2e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/commands/explain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ ExplainOneQuery(Query *query, int cursorOptions,
351351
/* if an advisor plugin is present, let it manage things */
352352
if (ExplainOneQuery_hook)
353353
(*ExplainOneQuery_hook) (query, cursorOptions, into, es,
354-
queryString, params);
354+
queryString, params, queryEnv);
355355
else
356356
{
357357
PlannedStmt *plan;

src/include/commands/explain.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ typedef void (*ExplainOneQuery_hook_type) (Query *query,
5353
IntoClause *into,
5454
ExplainState *es,
5555
const char *queryString,
56-
ParamListInfo params);
56+
ParamListInfo params,
57+
QueryEnvironment *queryEnv);
5758
extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
5859

5960
/* Hook for plugins to get control in explain_get_index_name() */

0 commit comments

Comments
 (0)