diff --git a/src/backend/distributed/executor/citus_custom_scan.c b/src/backend/distributed/executor/citus_custom_scan.c index e320dd2a3..e98de4391 100644 --- a/src/backend/distributed/executor/citus_custom_scan.c +++ b/src/backend/distributed/executor/citus_custom_scan.c @@ -162,6 +162,11 @@ CitusBeginScan(CustomScanState *node, EState *estate, int eflags) MarkCitusInitiatedCoordinatorBackend(); scanState = (CitusScanState *) node; + +#if PG_VERSION_NUM >= 120000 + ExecInitResultSlot(&scanState->customScanState.ss.ps, &TTSOpsMinimalTuple); +#endif + distributedPlan = scanState->distributedPlan; if (distributedPlan->modLevel == ROW_MODIFY_READONLY || distributedPlan->insertSelectSubquery != NULL) diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index 465122281..b8c7ccb1a 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -264,9 +264,9 @@ RangeVarGetRelidInternal(const RangeVar *relation, LOCKMODE lockmode, uint32 fla #define FileWriteCompat FileWrite #define fcSetArg(fc, n, argval) \ - ((fc)->args[n].isnull = false, (fc)->args[n].value = (argval)) -#define fcSetArgNull(fc, n) \ - ((fc)->args[n].isnull = true, (fc)->args[n].value = (Datum) 0) + (((fc)->args[n].isnull = false), ((fc)->args[n].value = (argval))) + #define fcSetArgNull(fc, n) \ + (((fc)->args[n].isnull = true), ((fc)->args[n].value = (Datum) 0)) #else /* pre PG12 */ #define QTW_EXAMINE_RTES_BEFORE QTW_EXAMINE_RTES