mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Ensure that all TransactionId comparisons are encapsulated in macros
(TransactionIdPrecedes, TransactionIdFollows, etc). First step on the way to transaction ID wrap solution ...
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.37 2001/07/16 22:43:34 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.38 2001/08/23 23:06:37 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -241,12 +241,12 @@ GetXmaxRecent(TransactionId *XmaxRecent)
|
||||
/* Fetch xid just once - see GetNewTransactionId */
|
||||
TransactionId xid = proc->xid;
|
||||
|
||||
if (! TransactionIdIsSpecial(xid))
|
||||
if (TransactionIdIsNormal(xid))
|
||||
{
|
||||
if (TransactionIdPrecedes(xid, result))
|
||||
result = xid;
|
||||
xid = proc->xmin;
|
||||
if (! TransactionIdIsSpecial(xid))
|
||||
if (TransactionIdIsNormal(xid))
|
||||
if (TransactionIdPrecedes(xid, result))
|
||||
result = xid;
|
||||
}
|
||||
@@ -347,8 +347,8 @@ GetSnapshotData(bool serializable)
|
||||
* treat them as running anyway.
|
||||
*/
|
||||
if (proc == MyProc ||
|
||||
TransactionIdIsSpecial(xid) ||
|
||||
! TransactionIdPrecedes(xid, snapshot->xmax))
|
||||
! TransactionIdIsNormal(xid) ||
|
||||
TransactionIdFollowsOrEquals(xid, snapshot->xmax))
|
||||
continue;
|
||||
|
||||
if (TransactionIdPrecedes(xid, snapshot->xmin))
|
||||
@@ -364,7 +364,7 @@ GetSnapshotData(bool serializable)
|
||||
SpinRelease(SInvalLock);
|
||||
|
||||
/* Serializable snapshot must be computed before any other... */
|
||||
Assert(MyProc->xmin != InvalidTransactionId);
|
||||
Assert(TransactionIdIsValid(MyProc->xmin));
|
||||
|
||||
snapshot->xcnt = count;
|
||||
return snapshot;
|
||||
|
||||
Reference in New Issue
Block a user