Skip to content

Commit 193ce08

Browse files
authored
Merge pull request #81 from RekGRpth/pg18
Fix compatibility with pg18
2 parents b79a816 + ce5d628 commit 193ce08

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

Diff for: pg_wait_sampling.c

+18-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ static PlannedStmt *pgws_planner_hook(Query *parse,
7676
static void pgws_ExecutorStart(QueryDesc *queryDesc, int eflags);
7777
static void pgws_ExecutorRun(QueryDesc *queryDesc,
7878
ScanDirection direction,
79-
uint64 count, bool execute_once);
79+
uint64 count
80+
#if PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 180000
81+
, bool execute_once
82+
#endif
83+
);
8084
static void pgws_ExecutorFinish(QueryDesc *queryDesc);
8185
static void pgws_ExecutorEnd(QueryDesc *queryDesc);
8286
static void pgws_ProcessUtility(PlannedStmt *pstmt,
@@ -1036,7 +1040,11 @@ pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
10361040
static void
10371041
pgws_ExecutorRun(QueryDesc *queryDesc,
10381042
ScanDirection direction,
1039-
uint64 count, bool execute_once)
1043+
uint64 count
1044+
#if PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 180000
1045+
, bool execute_once
1046+
#endif
1047+
)
10401048
{
10411049
int i = MyProc - ProcGlobal->allProcs;
10421050
uint64 save_queryId = pgws_proc_queryids[i];
@@ -1045,9 +1053,17 @@ pgws_ExecutorRun(QueryDesc *queryDesc,
10451053
PG_TRY();
10461054
{
10471055
if (prev_ExecutorRun)
1056+
#if PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 180000
10481057
prev_ExecutorRun(queryDesc, direction, count, execute_once);
1058+
#else
1059+
prev_ExecutorRun(queryDesc, direction, count);
1060+
#endif
10491061
else
1062+
#if PG_VERSION_NUM >= 100000 && PG_VERSION_NUM < 180000
10501063
standard_ExecutorRun(queryDesc, direction, count, execute_once);
1064+
#else
1065+
standard_ExecutorRun(queryDesc, direction, count);
1066+
#endif
10511067
nesting_level--;
10521068
if (nesting_level == 0)
10531069
pgws_proc_queryids[i] = UINT64CONST(0);

0 commit comments

Comments
 (0)