Re: pgsql: Add deduplication to nbtree.

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: pgsql: Add deduplication to nbtree.
Дата
Msg-id 21800dbe-a13e-22f7-d423-b81db9d249f5@2ndquadrant.com
обсуждение исходный текст
Ответ на pgsql: Add deduplication to nbtree.  (Peter Geoghegan <pg@bowt.ie>)
Ответы Re: pgsql: Add deduplication to nbtree.  (Peter Geoghegan <pg@bowt.ie>)
Список 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



В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Doc: update sections 9.14 - 9.16 for new function table layout.
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: pgsql: Add deduplication to nbtree.