Commit ccca6f56 authored by Tom Lane's avatar Tom Lane

Fix ancient docs/comments thinko: XID comparison is mod 2^32, not 2^31.

Pointed out by Gianni Ciolli.
parent f2609905
...@@ -401,7 +401,7 @@ ...@@ -401,7 +401,7 @@
as <literal>FrozenXID</>. This XID does not follow the normal XID as <literal>FrozenXID</>. This XID does not follow the normal XID
comparison rules and is always considered older comparison rules and is always considered older
than every normal XID. Normal XIDs are than every normal XID. Normal XIDs are
compared using modulo-2<superscript>31</> arithmetic. This means compared using modulo-2<superscript>32</> arithmetic. This means
that for every normal XID, there are two billion XIDs that are that for every normal XID, there are two billion XIDs that are
<quote>older</> and two billion that are <quote>newer</>; another <quote>older</> and two billion that are <quote>newer</>; another
way to say it is that the normal XID space is circular with no way to say it is that the normal XID space is circular with no
......
...@@ -301,7 +301,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2) ...@@ -301,7 +301,7 @@ TransactionIdPrecedes(TransactionId id1, TransactionId id2)
{ {
/* /*
* If either ID is a permanent XID then we can just do unsigned * If either ID is a permanent XID then we can just do unsigned
* comparison. If both are normal, do a modulo-2^31 comparison. * comparison. If both are normal, do a modulo-2^32 comparison.
*/ */
int32 diff; int32 diff;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment