From ed9e2cd44f0f1cc50bdbd4577654a4be5f032e40 Mon Sep 17 00:00:00 2001 From: Halil Ozan Akgul Date: Tue, 17 Aug 2021 14:04:50 +0300 Subject: [PATCH] Introduces SetTuplestoreDestReceiverParams_compat macro SetTuplestoreDestReceiverParams function now has two new parameters This new macro give us the ability to use this new parameter for PG14 and it doesn't give the parameter for previous versions Existing parameters are set to NULL to keep previous behavior Relevant PG commit: 2f48ede080f42b97b594fb14102c82ca1001b80c --- src/backend/distributed/planner/multi_explain.c | 4 ++-- src/include/distributed/version_compat.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backend/distributed/planner/multi_explain.c b/src/backend/distributed/planner/multi_explain.c index df7db64a0..084700fa0 100644 --- a/src/backend/distributed/planner/multi_explain.c +++ b/src/backend/distributed/planner/multi_explain.c @@ -1024,8 +1024,8 @@ worker_save_query_explain_analyze(PG_FUNCTION_ARGS) TupleDesc tupleDescriptor = NULL; Tuplestorestate *tupleStore = SetupTuplestore(fcinfo, &tupleDescriptor); DestReceiver *tupleStoreDest = CreateTuplestoreDestReceiver(); - SetTuplestoreDestReceiverParams(tupleStoreDest, tupleStore, - CurrentMemoryContext, false); + SetTuplestoreDestReceiverParams_compat(tupleStoreDest, tupleStore, + CurrentMemoryContext, false, NULL, NULL); List *parseTreeList = pg_parse_query(queryString); if (list_length(parseTreeList) != 1) diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index e5df7a264..29fa67c5f 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -55,6 +55,8 @@ #define ProcessUtility_compat(a, b, c, d, e, f, g, h) \ ProcessUtility(a, b, c, d, e, f, g, h) #define COPY_FRONTEND_COMPAT COPY_FRONTEND +#define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \ + SetTuplestoreDestReceiverParams(a, b, c, d, e, f) #else #define AlterTableStmtObjType(a) ((a)->relkind) #define F_NEXTVAL_COMPAT F_NEXTVAL_OID @@ -82,6 +84,8 @@ standard_ProcessUtility(a, b, d, e, f, g, h) #define ProcessUtility_compat(a, b, c, d, e, f, g, h) ProcessUtility(a, b, d, e, f, g, h) #define COPY_FRONTEND_COMPAT COPY_NEW_FE +#define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \ + SetTuplestoreDestReceiverParams(a, b, c, d) #endif #if PG_VERSION_NUM >= PG_VERSION_13