Re: pgsql: Add deduplication to nbtree.

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Add deduplication to nbtree.
Date: 2020-04-30 18:33:19
Message-ID: 21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2020-04-30 18:37:38 Re: pgsql: Add deduplication to nbtree.
Previous Message Tom Lane 2020-04-30 16:53:50 pgsql: Doc: update sections 9.14 - 9.16 for new function table layout.