pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix misuse of table_index_fetch_tuple_check().
Date: Thu, 25 Jun 2020 17:56:13 +0000
Message-ID: <E1joW6f-0007eK-UN@gemulon.postgresql.org> (raw)

Fix misuse of table_index_fetch_tuple_check().

Commit 0d861bbb, which added deduplication to nbtree, had
_bt_check_unique() pass a TID to table_index_fetch_tuple_check() that
isn't safe to mutate.  table_index_fetch_tuple_check()'s tid argument is
modified when the TID in question is not the latest visible tuple in a
hot chain, though this wasn't documented.

To fix, go back to using a local copy of the TID in _bt_check_unique(),
and update comments above table_index_fetch_tuple_check().

Backpatch: 13-, where B-Tree deduplication was introduced.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/10f1ab2cb8bea3c6741a78f6dc19a5c91c0a34e1

Modified Files
--------------
src/backend/access/nbtree/nbtinsert.c | 3 ++-
src/backend/access/table/tableam.c    | 4 ++++
src/include/access/tableam.h          | 4 +++-
3 files changed, 9 insertions(+), 2 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1joW6f-0007eK-UN@gemulon.postgresql.org>
Permalink:  ../E1joW6f-0007eK-UN@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1joW6f-0007eK-UN@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: pg@bowt.ie
  Subject: Re: pgsql: Fix misuse of table_index_fetch_tuple_check().
  In-Reply-To: <E1joW6f-0007eK-UN@gemulon.postgresql.org>
  References: <E1joW6f-0007eK-UN@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