1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-08 00:47:37 +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:
Tom Lane
2001-08-23 23:06:38 +00:00
parent 29ec29ffac
commit 7326e78c42
17 changed files with 139 additions and 100 deletions

View File

@@ -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;

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.91 2001/07/09 22:18:33 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.92 2001/08/23 23:06:38 tgl Exp $
*
* NOTES
* Outside modules can create a lock table and acquire/release
@@ -1277,7 +1277,7 @@ LockReleaseAll(LOCKMETHOD lockmethod, PROC *proc,
goto next_item;
/* If not allxids, ignore items that are of the wrong xid */
if (!allxids && xid != holder->tag.xid)
if (!allxids && !TransactionIdEquals(xid, holder->tag.xid))
goto next_item;
HOLDER_PRINT("LockReleaseAll", holder);