Introduces STATUS_WAITING_COMPAT macro

The STATUS_WAITING define is removed and an enum with PROC_WAIT_STATUS_WAITING is added instead
This macro uses appropriate one

Relevant PG commit:
a513f1dfbf2c29a51b0f7cbd5913ce2d2ee452c5
pull/5209/head
Halil Ozan Akgul 2021-08-11 15:47:41 +03:00 committed by Sait Talha Nisanci
parent 3c10e0f568
commit f8d3e50f25
2 changed files with 4 additions and 2 deletions

View File

@ -456,7 +456,7 @@ BuildLocalWaitGraph(void)
static bool
IsProcessWaitingForSafeOperations(PGPROC *proc)
{
if (proc->waitStatus != STATUS_WAITING)
if (proc->waitStatus != PROC_WAIT_STATUS_WAITING)
{
return false;
}
@ -715,7 +715,7 @@ AddProcToVisit(PROCStack *remaining, PGPROC *proc)
bool
IsProcessWaitingForLock(PGPROC *proc)
{
return proc->waitStatus == STATUS_WAITING;
return proc->waitStatus == PROC_WAIT_STATUS_WAITING;
}

View File

@ -34,10 +34,12 @@
#define AlterTableStmtObjType(a) ((a)->objtype)
#define F_NEXTVAL_COMPAT F_NEXTVAL
#define ROLE_MONITOR_COMPAT ROLE_PG_MONITOR
#define STATUS_WAITING_COMPAT PROC_WAIT_STATUS_WAITING
#else
#define AlterTableStmtObjType(a) ((a)->relkind)
#define F_NEXTVAL_COMPAT F_NEXTVAL_OID
#define ROLE_MONITOR_COMPAT DEFAULT_ROLE_MONITOR
#define STATUS_WAITING_COMPAT STATUS_WAITING
#endif
#if PG_VERSION_NUM >= PG_VERSION_13