Skip to content

Commit 94bb71b

Browse files
committed
Fix definition of planner hook
The planner hook has changed its definition in upstream commit c83ac02ec730. This commit makes pg_hint_plan able to compile again, by switching to the new world order. At the point, the regression tests are able to run, with diffs in plans that depend on other changes happening in upstream. The state of the code is enough to investigate different issues.
1 parent b146c3b commit 94bb71b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pg_hint_plan.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,8 @@ static void pg_hint_plan_post_parse_analyze(ParseState *pstate, Query *query,
436436
JumbleState *jstate);
437437
static PlannedStmt *pg_hint_plan_planner(Query *parse, const char *query_string,
438438
int cursorOptions,
439-
ParamListInfo boundParams);
439+
ParamListInfo boundParams,
440+
ExplainState *es);
440441
static RelOptInfo *pg_hint_plan_join_search(PlannerInfo *root,
441442
int levels_needed,
442443
List *initial_rels);
@@ -3115,7 +3116,8 @@ pg_hint_plan_post_parse_analyze(ParseState *pstate, Query *query,
31153116
* Read and set up hint information
31163117
*/
31173118
static PlannedStmt *
3118-
pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions, ParamListInfo boundParams)
3119+
pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions,
3120+
ParamListInfo boundParams, ExplainState *es)
31193121
{
31203122
int save_nestlevel;
31213123
PlannedStmt *result;
@@ -3247,10 +3249,10 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions,
32473249

32483250
if (prev_planner)
32493251
result = (*prev_planner) (parse, query_string,
3250-
cursorOptions, boundParams);
3252+
cursorOptions, boundParams, es);
32513253
else
32523254
result = standard_planner(parse, query_string,
3253-
cursorOptions, boundParams);
3255+
cursorOptions, boundParams, es);
32543256

32553257
current_hint_str = prev_hint_str;
32563258
recurse_level--;
@@ -3308,10 +3310,10 @@ pg_hint_plan_planner(Query *parse, const char *query_string, int cursorOptions,
33083310
current_hint_state = NULL;
33093311
if (prev_planner)
33103312
result = (*prev_planner) (parse, query_string,
3311-
cursorOptions, boundParams);
3313+
cursorOptions, boundParams, es);
33123314
else
33133315
result = standard_planner(parse, query_string,
3314-
cursorOptions, boundParams);
3316+
cursorOptions, boundParams, es);
33153317

33163318
/* The upper-level planner still needs the current hint state */
33173319
if (HintStateStack != NIL)

typedefs.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Datum
22
DisableIndexHint
3+
ExplainState
34
FmgrInfo
45
Hint
56
HintKeyword

0 commit comments

Comments
 (0)