Introduces proc_statusflags_compat macro

In two commits vacuumFlags in PGXACT is moved and then renamed to status flags
This macro uses the appropriate version of the flag

Relevant PG commits:
5788e258bb26495fab65ff3aa486268d1c50b123
cd9c1b3e197a9b53b840dcc87eb41b04d601a5f9
pull/5209/head
Halil Ozan Akgul 2021-08-17 14:37:05 +03:00 committed by Sait Talha Nisanci
parent 287706b717
commit 898d3bb8d3
2 changed files with 4 additions and 3 deletions

View File

@ -461,9 +461,7 @@ IsProcessWaitingForSafeOperations(PGPROC *proc)
return false;
}
/* get the transaction that the backend associated with */
PGXACT *pgxact = &ProcGlobal->allPgXact[proc->pgprocno];
if (pgxact->vacuumFlags & PROC_IS_AUTOVACUUM)
if (pgproc_statusflags_compat(proc) & PROC_IS_AUTOVACUUM)
{
return true;
}

View File

@ -57,6 +57,7 @@
#define COPY_FRONTEND_COMPAT COPY_FRONTEND
#define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \
SetTuplestoreDestReceiverParams(a, b, c, d, e, f)
#define pgproc_statusflags_compat(pgproc) ((pgproc)->statusFlags)
#else
#define AlterTableStmtObjType(a) ((a)->relkind)
#define F_NEXTVAL_COMPAT F_NEXTVAL_OID
@ -86,6 +87,8 @@
#define COPY_FRONTEND_COMPAT COPY_NEW_FE
#define SetTuplestoreDestReceiverParams_compat(a, b, c, d, e, f) \
SetTuplestoreDestReceiverParams(a, b, c, d)
#define pgproc_statusflags_compat(pgproc) \
((&ProcGlobal->allPgXact[(pgproc)->pgprocno])->vacuumFlags)
#endif
#if PG_VERSION_NUM >= PG_VERSION_13