Fix off-by-one error in txid_status().
Thomas Munro <tmunro@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/txid.c | modified | +4 −4 |
Discussion
- txid_status() off-by-one error 2 messages · 2019-03-27