Skip to content

Commit b83e27b

Browse files
committed
Merge with migration_to_pg10 branch
2 parents 171696f + d1557d2 commit b83e27b

16 files changed

+919
-288
lines changed

src/compat/pg_compat.c

Lines changed: 428 additions & 122 deletions
Large diffs are not rendered by default.

src/hooks.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,19 @@ pathman_join_pathlist_hook(PlannerInfo *root,
217217
return;
218218

219219

220+
#if PG_VERSION_NUM >= 100000
221+
initial_cost_nestloop(root, &workspace, jointype,
222+
outer, inner, /* built paths */
223+
extra);
224+
225+
nest_path = create_nestloop_path(root, joinrel, jointype, &workspace,
226+
extra, outer, inner,
227+
extra->restrictlist,
228+
build_join_pathkeys(root, joinrel,
229+
jointype,
230+
outer->pathkeys),
231+
required_nestloop);
232+
#else
220233
initial_cost_nestloop(root, &workspace, jointype,
221234
outer, inner, /* built paths */
222235
extra->sjinfo, &extra->semifactors);
@@ -228,6 +241,7 @@ pathman_join_pathlist_hook(PlannerInfo *root,
228241
jointype,
229242
outer->pathkeys),
230243
required_nestloop);
244+
#endif
231245

232246
/* Discard all clauses that are to be evaluated by 'inner' */
233247
foreach (rinfo_lc, extra->restrictlist)
@@ -760,6 +774,17 @@ pathman_relcache_hook(Datum arg, Oid relid)
760774
/*
761775
* Utility function invoker hook.
762776
*/
777+
#if PG_VERSION_NUM >= 100000
778+
void
779+
pathman_process_utility_hook(PlannedStmt *pstmt,
780+
const char *queryString,
781+
ProcessUtilityContext context,
782+
ParamListInfo params,
783+
QueryEnvironment *queryEnv,
784+
DestReceiver *dest, char *completionTag)
785+
{
786+
Node *parsetree = pstmt->utilityStmt;
787+
#else
763788
void
764789
pathman_process_utility_hook(Node *parsetree,
765790
const char *queryString,
@@ -768,6 +793,8 @@ pathman_process_utility_hook(Node *parsetree,
768793
DestReceiver *dest,
769794
char *completionTag)
770795
{
796+
#endif
797+
771798
if (IsPathmanReady())
772799
{
773800
Oid relation_oid;
@@ -815,6 +842,18 @@ pathman_process_utility_hook(Node *parsetree,
815842
}
816843
}
817844

845+
#if PG_VERSION_NUM >= 100000
846+
/* Call hooks set by other extensions if needed */
847+
if (process_utility_hook_next)
848+
process_utility_hook_next(pstmt, queryString,
849+
context, params, queryEnv,
850+
dest, completionTag);
851+
/* Else call internal implementation */
852+
else
853+
standard_ProcessUtility(pstmt, queryString,
854+
context, params, queryEnv,
855+
dest, completionTag);
856+
#else
818857
/* Call hooks set by other extensions if needed */
819858
if (process_utility_hook_next)
820859
process_utility_hook_next(parsetree, queryString,
@@ -825,4 +864,5 @@ pathman_process_utility_hook(Node *parsetree,
825864
standard_ProcessUtility(parsetree, queryString,
826865
context, params,
827866
dest, completionTag);
867+
#endif
828868
}

0 commit comments

Comments
 (0)