pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Peter Geoghegan <pg@bowt.ie>
To: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Add deduplication to nbtree.
Date: Thu, 30 Apr 2020 20:33:19 +0200
Message-ID: <21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com> (raw)
In-Reply-To: <E1j73sn-0003FQ-KO@gemulon.postgresql.org>
References: <E1j73sn-0003FQ-KO@gemulon.postgresql.org>

On 2020-02-26 22:06, Peter Geoghegan wrote:
> Add deduplication to nbtree.

AddressSanitizer has a use-after-scope complaint related to this patch.

The following change fixes it:

diff --git a/src/backend/access/nbtree/nbtinsert.c b/src/backend/access/nbtree/nbtinsert.c
index a70b64d964..8246ab4f18 100644
--- a/src/backend/access/nbtree/nbtinsert.c
+++ b/src/backend/access/nbtree/nbtinsert.c
@@ -1289,6 +1289,7 @@ _bt_insertonpg(Relation rel,
 			xl_btree_metadata xlmeta;
 			uint8		xlinfo;
 			XLogRecPtr	recptr;
+			uint16		upostingoff;
 
 			xlrec.offnum = newitemoff;
 
@@ -1354,7 +1355,7 @@ _bt_insertonpg(Relation rel,
 				 * must reconstruct final itup (as well as nposting) using
 				 * _bt_swap_posting().
 				 */
-				uint16		upostingoff = postingoff;
+				upostingoff = postingoff;
 
 				XLogRegisterBufData(0, (char *) &upostingoff, sizeof(uint16));
 				XLogRegisterBufData(0, (char *) origitup,

Please check.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (22+ messages)  latest in thread

Message-ID: <21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com>
Permalink:  ../21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com/
Also on:    postgresql.org/message-id/21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, pg@bowt.ie, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add deduplication to nbtree.
  In-Reply-To: <21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com>

* 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