Skip to content

Commit dd524f2

Browse files
authored
Fix compatibility with pg18
Upstream commit postgres/postgres@525392d changed return type of ExecutorStart_hook API from void to bool.
1 parent e3b1e15 commit dd524f2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pg_wait_sampling.c

+15-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ static PlannedStmt *pgws_planner_hook(Query *parse,
7373
constchar*query_string,
7474
#endif
7575
intcursorOptions, ParamListInfoboundParams);
76-
staticvoidpgws_ExecutorStart(QueryDesc*queryDesc, inteflags);
76+
static
77+
#ifPG_VERSION_NUM >= 180000
78+
bool
79+
#else
80+
void
81+
#endif
82+
pgws_ExecutorStart(QueryDesc*queryDesc, inteflags);
7783
staticvoidpgws_ExecutorRun(QueryDesc*queryDesc,
7884
ScanDirectiondirection,
7985
uint64count
@@ -965,16 +971,21 @@ pgws_planner_hook(Query *parse,
965971
/*
966972
* ExecutorStart hook: save queryId for collector
967973
*/
968-
staticvoid
974+
static
975+
#ifPG_VERSION_NUM >= 180000
976+
bool
977+
#else
978+
void
979+
#endif
969980
pgws_ExecutorStart(QueryDesc*queryDesc, inteflags)
970981
{
971982
inti=MyProc-ProcGlobal->allProcs;
972983
if (pgws_enabled(nesting_level))
973984
pgws_proc_queryids[i] =queryDesc->plannedstmt->queryId;
974985
if (prev_ExecutorStart)
975-
prev_ExecutorStart(queryDesc, eflags);
986+
returnprev_ExecutorStart(queryDesc, eflags);
976987
else
977-
standard_ExecutorStart(queryDesc, eflags);
988+
returnstandard_ExecutorStart(queryDesc, eflags);
978989
}
979990

980991
staticvoid

0 commit comments

Comments
 (0)
close