pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Munro <tmunro@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix off-by-one error in txid_status().
Date: Wed, 27 Mar 2019 08:47:49 +0000
Message-ID: <E1h94Dt-0000Ij-A2@gemulon.postgresql.org> (raw)

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/26d4fda37ea10d146e9d35fca70f817a0bfe300c

Modified Files
--------------
src/backend/utils/adt/txid.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1h94Dt-0000Ij-A2@gemulon.postgresql.org>
Permalink:  ../E1h94Dt-0000Ij-A2@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h94Dt-0000Ij-A2@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tmunro@postgresql.org
  Subject: Re: pgsql: Fix off-by-one error in txid_status().
  In-Reply-To: <E1h94Dt-0000Ij-A2@gemulon.postgresql.org>
  References: <E1h94Dt-0000Ij-A2@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox