Skip to content

Fix compatibility with PG13. #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions collector.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "postgres.h"

#include "catalog/pg_type.h"
#if PG_VERSION_NUM >= 130000
#include "common/hashfn.h"
#endif
#include "funcapi.h"
#include "miscadmin.h"
#include "postmaster/bgworker.h"
Expand Down
21 changes: 18 additions & 3 deletions pg_wait_sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ CollectorShmqHeader *collector_hdr = NULL;
static shmem_startup_hook_type prev_shmem_startup_hook = NULL;
static PGPROC * search_proc(int backendPid);
static PlannedStmt *pgws_planner_hook(Query *parse,
#if PG_VERSION_NUM >= 130000
const char *query_string,
#endif
int cursorOptions, ParamListInfo boundParams);
static void pgws_ExecutorEnd(QueryDesc *queryDesc);

Expand Down Expand Up @@ -771,7 +774,11 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
* planner_hook hook, save queryId for collector
*/
static PlannedStmt *
pgws_planner_hook(Query *parse, int cursorOptions,
pgws_planner_hook(Query *parse,
#if PG_VERSION_NUM >= 130000
const char *query_string,
#endif
int cursorOptions,
ParamListInfo boundParams)
{
if (MyProc)
Expand All @@ -795,9 +802,17 @@ pgws_planner_hook(Query *parse, int cursorOptions,

/* Invoke original hook if needed */
if (planner_hook_next)
return planner_hook_next(parse, cursorOptions, boundParams);
return planner_hook_next(parse,
#if PG_VERSION_NUM >= 130000
query_string,
#endif
cursorOptions, boundParams);

return standard_planner(parse, cursorOptions, boundParams);
return standard_planner(parse,
#if PG_VERSION_NUM >= 130000
query_string,
#endif
cursorOptions, boundParams);
}

/*
Expand Down