]> granicus.if.org Git - postgresql/commit
Fix off-by-one error in txid_status().
authorThomas Munro <tmunro@postgresql.org>
Wed, 27 Mar 2019 08:16:50 +0000 (21:16 +1300)
committerThomas Munro <tmunro@postgresql.org>
Wed, 27 Mar 2019 08:30:04 +0000 (21:30 +1300)
commitd2fd7f74ee61f41a3bd5daf2942b72cebd88f346
tree931fb937a69857d64191d6a4fa34d878f69c2aab
parent1983af8e899389187026cb34c1ca9d89ea986120
Fix off-by-one error in txid_status().

The transaction ID returned by GetNextXidAndEpoch() is in the future,
so we can't attempt to access its status or we might try to read a
CLOG page that doesn't exist.  The > vs >= confusion probably stemmed
from the choice of a variable name containing the word "last" instead
of "next", so fix that too.

Back-patch to 10 where the function arrived.

Author: Thomas Munro
Discussion: https://postgr.es/m/CA%2BhUKG%2Buua_BV5cyfsioKVN2d61Lukg28ECsWTXKvh%3DBtN2DPA%40mail.gmail.com
src/backend/utils/adt/txid.c