10000 Fix. Conventionally use of hooks. · postgrespro/aqo@271b0da · GitHub
[go: up one dir, main page]

Skip to content

Commit 271b0da

Browse files
Daniil Anisimovdanolivo
Daniil Anisimov
authored andcommitted
Fix. Conventionally use of hooks.
1 parent ee4ffc5 commit 271b0da

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

aqo_shared.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ aqo_init_shmem(void)
2929
HASHCTL info;
3030

3131
if (aqo_shmem_startup_next)
32-
aqo_shmem_startup_next();
32+
(*aqo_shmem_startup_next)();
3333

3434
aqo_state = NULL;
3535
stat_htab = NULL;
@@ -129,7 +129,7 @@ aqo_shmem_request(void)
129129
Size size;
130130

131131
if (aqo_shmem_request_next)
132-
aqo_shmem_request_next();
132+
(*aqo_shmem_request_next)();
133133

134134
size = MAXALIGN(sizeof(AQOSharedState));
135135
size = add_size(size, hash_estimate_size(fs_max_items, sizeof(AQOSharedState)));

cardinality_hooks.c

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

116116
default_estimator:
117117
rel->predicted_cardinality = -1.;
118-
aqo_set_baserel_rows_estimate_next(root, rel);
118+
(*aqo_set_baserel_rows_estimate_next)(root, rel);
119119
}
120120

121121
static void
@@ -226,7 +226,7 @@ aqo_get_parameterized_baserel_size(PlannerInfo *root,
226226
return predicted;
227227

228228
default_estimator:
229-
return aqo_get_parameterized_baserel_size_next(root, rel, param_clauses);
229+
return (*aqo_get_parameterized_baserel_size_next)(root, rel, param_clauses);
230230
}
231231

232232
/*
@@ -301,7 +301,7 @@ aqo_set_joinrel_size_estimates(PlannerInfo *root, RelOptInfo *rel,
301301

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

@@ -374,7 +374,7 @@ aqo_get_parameterized_joinrel_size(PlannerInfo *root,
374374
return predicted;
375375

376376
default_estimator:
377-
return aqo_get_parameterized_joinrel_size_next(root, rel,
377+
return (*aqo_get_parameterized_joinrel_size_next)(root, rel,
378378
outer_path, inner_path,
379379
sjinfo, clauses);
380380
}
@@ -463,7 +463,7 @@ aqo_estimate_num_groups(PlannerInfo *root, List *groupExprs,
463463

464464
default_estimator:
465465
if (aqo_estimate_num_groups_next)
466-
return aqo_estimate_num_groups_next(root, groupExprs, subpath,
466+
return (*aqo_estimate_num_groups_next)(root, groupExprs, subpath,
467467
grouped_rel, pgset, estinfo);
468468
else
469469
return estimate_num_groups(root, groupExprs, subpath->rows,

path_utils.c

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

527527
if (aqo_create_plan_next)
528-
aqo_create_plan_next(root, src, dest);
528+
(*aqo_create_plan_next)(root, src, dest);
529529

530530
if (!query_context.use_aqo && !query_context.learn_aqo &&
531531
!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
@@ -125,7 +125,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
125125
*/
126126
disable_aqo_for_query();
127127

128-
return aqo_planner_next(parse, query_string, cursorOptions, boundParams);
128+
return (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
129129
}
130130

131131
selectivity_cache_clear();
@@ -151,7 +151,7 @@ aqo_planner(Query *parse, const char *query_string, int cursorOptions,
151151
*/
152152
disable_aqo_for_query();
153153

154-
return aqo_planner_next(parse, query_string, cursorOptions, boundParams);
154+
return (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
155155
}
156156

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

322-
stmt = aqo_planner_next(parse, query_string, cursorOptions, boundParams);
322+
stmt = (*aqo_planner_next)(parse, query_string, cursorOptions, boundParams);
323323

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

0 commit comments

Comments
 (0)
0