Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b215f2

Browse files
Daniil Anisimovdanolivo
authored andcommitted
Fix. Conventionally use of hooks.
Also, some arrangement for stable14 added by a.lepikhov
1 parent e1761d4 commit 5b215f2

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

aqo_shared.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ aqo_init_shmem(void)
2828
HASHCTL info;
2929

3030
if (aqo_shmem_startup_next)
31-
aqo_shmem_startup_next();
31+
(*aqo_shmem_startup_next)();
3232

3333
aqo_state = NULL;
3434
stat_htab = NULL;

cardinality_hooks.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ aqo_set_baserel_rows_estimate(PlannerInfo *root, RelOptInfo *rel)
114114

115115
default_estimator:
116116
rel->predicted_cardinality = -1.;
117-
aqo_set_baserel_rows_estimate_next(root, rel);
117+
(*aqo_set_baserel_rows_estimate_next)(root, rel);
118118
}
119119

120120
static void
@@ -225,7 +225,7 @@ aqo_get_parameterized_baserel_size(PlannerInfo *root,
225225
return predicted;
226226

227227
default_estimator:
228-
return aqo_get_parameterized_baserel_size_next(root, rel, param_clauses);
228+
return (*aqo_get_parameterized_baserel_size_next)(root, rel, param_clauses);
229229
}
230230

231231
/*
@@ -300,7 +300,7 @@ aqo_set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
300300

301301
default_estimator:
302302
rel->predicted_cardinality = -1;
303-
aqo_set_joinrel_size_estimates_next(root, rel, outer_rel, inner_rel,
303+
(*aqo_set_joinrel_size_estimates_next)(root, rel, outer_rel, inner_rel,
304304
sjinfo, restrictlist);
305305
}
306306

@@ -373,7 +373,7 @@ aqo_get_parameterized_joinrel_size(PlannerInfo *root,
373373
return predicted;
374374

375375
default_estimator:
376-
return aqo_get_parameterized_joinrel_size_next(root, rel,
376+
return (*aqo_get_parameterized_joinrel_size_next)(root, rel,
377377
outer_path, inner_path,
378378
sjinfo, clauses);
379379
}
@@ -458,8 +458,8 @@ aqo_estimate_num_groups(PlannerInfo *root, List *groupExprs,
458458

459459
default_estimator:
460460
if (aqo_estimate_num_groups_next)
461-
return aqo_estimate_num_groups_next(root, groupExprs, subpath,
462-
grouped_rel, pgset);
461+
return (*aqo_estimate_num_groups_next)(root, groupExprs, subpath,
462+
grouped_rel, pgset);
463463
else
464464
return estimate_num_groups(root, groupExprs, subpath->rows,
465465
pgset);

path_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ aqo_create_plan(PlannerInfo *root, Path *src, Plan **dest)
542542
AQOPlanNode *node;
543543

544544
if (aqo_create_plan_next)
545-
aqo_create_plan_next(root, src, dest);
545+
(*aqo_create_plan_next)(root, src, dest);
546546

547547
if (!query_context.use_aqo && !query_context.learn_aqo &&
548548
!query_context.collect_stat)

postprocessing.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ aqo_ExecutorStart(QueryDesc *queryDesc, int eflags)
600600
StoreToQueryEnv(queryDesc);
601601
}
602602

603-
aqo_ExecutorStart_next(queryDesc, eflags);
603+
(*aqo_ExecutorStart_next)(queryDesc, eflags);
604604

605605
if (use_aqo)
606606
StorePlanInternals(queryDesc);
@@ -725,7 +725,7 @@ aqo_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, uint64 count,
725725

726726
PG_TRY();
727727
{
728-
aqo_ExecutorRun_next(queryDesc, direction, count, execute_once);
728+
(*aqo_ExecutorRun_next)(queryDesc, direction, count, execute_once);
729729
}
730730
PG_FINALLY();
731731
{
@@ -841,7 +841,7 @@ aqo_ExecutorEnd(QueryDesc *queryDesc)
841841
MemoryContextSwitchTo(oldctx);
842842
MemoryContextReset(AQOLearnMemCtx);
843843

844-
aqo_ExecutorEnd_next(queryDesc);
844+
(*aqo_ExecutorEnd_next)(queryDesc);
845845

846846
/*
847847
* standard_ExecutorEnd clears the queryDesc->planstate. After this point no
@@ -982,7 +982,7 @@ print_into_explain(PlannedStmt *plannedstmt, IntoClause *into,
982982
QueryEnvironment *queryEnv)
983983
{
984984
if (aqo_ExplainOnePlan_next)
985-
aqo_ExplainOnePlan_next(plannedstmt, into, es, queryString,
985+
(*aqo_ExplainOnePlan_next)(plannedstmt, into, es, queryString,
986986
params, planduration, queryEnv);
987987

988988
if (IsQueryDisabled() || !aqo_show_details)
@@ -1038,7 +1038,7 @@ print_node_explain(ExplainState *es, PlanState *ps, Plan *plan)
10381038

10391039
/* Extension, which took a hook early can be executed early too. */
10401040
if (aqo_ExplainOneNode_next)
1041-
aqo_ExplainOneNode_next(es, ps, plan);
1041+
(*aqo_ExplainOneNode_next)(es, ps, plan);
10421042

10431043
if (IsQueryDisabled() || !plan || es->format != EXPLAIN_FORMAT_TEXT)
10441044
return;

preprocessing.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
128128
MemoryContextSwitchTo(oldctx);
129129
disable_aqo_for_query();
130130

131-
return aqo_planner_next(parse, query_string, cursorOptions, boundParams);
131+
return (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
132132
}
133133

134134
selectivity_cache_clear();
@@ -149,7 +149,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
149149
MemoryContextSwitchTo(oldctx);
150150
disable_aqo_for_query();
151151

152-
return aqo_planner_next(parse, query_string, cursorOptions, boundParams);
152+
return (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
153153
}
154154

155155
elog(DEBUG1, "AQO will be used for query '%s', class "UINT64_FORMAT,
@@ -320,7 +320,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
320320
PlannedStmt *stmt;
321321

322322
MemoryContextSwitchTo(oldctx);
323-
stmt = aqo_planner_next(parse, query_string, cursorOptions, boundParams);
323+
stmt = (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
324324

325325
/* Release the memory, allocated for AQO predictions */
326326
MemoryContextReset(AQOPredictMemCtx);

0 commit comments

Comments
 (0)