diff --git a/src/backend/columnar/columnar_debug.c b/src/backend/columnar/columnar_debug.c index 5b62a3b56..5525bb032 100644 --- a/src/backend/columnar/columnar_debug.c +++ b/src/backend/columnar/columnar_debug.c @@ -17,6 +17,7 @@ #include "catalog/pg_type.h" #include "distributed/pg_version_constants.h" #include "distributed/tuplestore.h" +#include "distributed/version_compat.h" #include "miscadmin.h" #include "storage/fd.h" #include "storage/smgr.h" @@ -161,5 +162,5 @@ MemoryContextTotals(MemoryContext context, MemoryContextCounters *counters) MemoryContextTotals(child, counters); } - context->methods->stats(context, NULL, NULL, counters); + context->methods->stats_compat(context, NULL, NULL, counters, true); } diff --git a/src/backend/distributed/test/xact_stats.c b/src/backend/distributed/test/xact_stats.c index 05723aa35..c31a17b7f 100644 --- a/src/backend/distributed/test/xact_stats.c +++ b/src/backend/distributed/test/xact_stats.c @@ -19,6 +19,7 @@ #include "pgstat.h" #include "distributed/transaction_management.h" +#include "distributed/version_compat.h" static Size MemoryContextTotalSpace(MemoryContext context); @@ -47,7 +48,8 @@ MemoryContextTotalSpace(MemoryContext context) Size totalSpace = 0; MemoryContextCounters totals = { 0 }; - TopTransactionContext->methods->stats(TopTransactionContext, NULL, NULL, &totals); + TopTransactionContext->methods->stats_compat(TopTransactionContext, NULL, NULL, + &totals, true); totalSpace += totals.totalspace; for (MemoryContext child = context->firstchild; diff --git a/src/include/distributed/version_compat.h b/src/include/distributed/version_compat.h index aa438ad0e..f4a036a01 100644 --- a/src/include/distributed/version_compat.h +++ b/src/include/distributed/version_compat.h @@ -37,6 +37,9 @@ #define STATUS_WAITING_COMPAT PROC_WAIT_STATUS_WAITING #define getObjectTypeDescription_compat(a, b) getObjectTypeDescription(a, b) #define getObjectIdentity_compat(a, b) getObjectIdentity(a, b) + +/* for MemoryContextMethods->stats */ +#define stats_compat(a, b, c, d, e) stats(a, b, c, d, e) #else #define AlterTableStmtObjType(a) ((a)->relkind) #define F_NEXTVAL_COMPAT F_NEXTVAL_OID @@ -44,6 +47,9 @@ #define STATUS_WAITING_COMPAT STATUS_WAITING #define getObjectTypeDescription_compat(a, b) getObjectTypeDescription(a) #define getObjectIdentity_compat(a, b) getObjectIdentity(a) + +/* for MemoryContextMethods->stats */ +#define stats_compat(a, b, c, d, e) stats(a, b, c, d) #endif #if PG_VERSION_NUM >= PG_VERSION_13