1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +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/utils/time/tqual.c,v 1.39 2001/07/16 22:43:34 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.40 2001/08/23 23:06:38 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -531,15 +531,15 @@ HeapTupleSatisfiesSnapshot(HeapTupleHeader tuple, Snapshot snapshot)
* when...
*/
if (tuple->t_xmin >= snapshot->xmax)
if (TransactionIdFollowsOrEquals(tuple->t_xmin, snapshot->xmax))
return false;
if (tuple->t_xmin >= snapshot->xmin)
if (TransactionIdFollowsOrEquals(tuple->t_xmin, snapshot->xmin))
{
uint32 i;
for (i = 0; i < snapshot->xcnt; i++)
{
if (tuple->t_xmin == snapshot->xip[i])
if (TransactionIdEquals(tuple->t_xmin, snapshot->xip[i]))
return false;
}
}
@@ -571,15 +571,15 @@ HeapTupleSatisfiesSnapshot(HeapTupleHeader tuple, Snapshot snapshot)
tuple->t_infomask |= HEAP_XMAX_COMMITTED;
}
if (tuple->t_xmax >= snapshot->xmax)
if (TransactionIdFollowsOrEquals(tuple->t_xmax, snapshot->xmax))
return true;
if (tuple->t_xmax >= snapshot->xmin)
if (TransactionIdFollowsOrEquals(tuple->t_xmax, snapshot->xmin))
{
uint32 i;
for (i = 0; i < snapshot->xcnt; i++)
{
if (tuple->t_xmax == snapshot->xip[i])
if (TransactionIdEquals(tuple->t_xmax, snapshot->xip[i]))
return true;
}
}