RE: [PATCH] Keeps tracking the uniqueness with UniqueKey

Поиск
Список
Период
Сортировка
От Floris Van Nee
Тема RE: [PATCH] Keeps tracking the uniqueness with UniqueKey
Дата
Msg-id c22a9b43bdbe47caa862cb9302e6ffdb@opammb0561.comp.optiver.com
обсуждение исходный текст
Ответ на Re: [PATCH] Keeps tracking the uniqueness with UniqueKey  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: [PATCH] Keeps tracking the uniqueness with UniqueKey  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-hackers

Hi Andy,

 

A small thing I found:

 

+static List *

+get_exprs_from_uniqueindex(IndexOptInfo *unique_index,

+                                                                                                List *const_exprs,

+                                                                                                List *const_expr_opfamilies,

+                                                                                                Bitmapset *used_varattrs,

+                                                                                                bool *useful,

+                                                                                                bool *multi_nullvals)

+             indexpr_item = list_head(unique_index->indexprs);

+             for(c = 0; c < unique_index->ncolumns; c++)

+             {

 

I believe the for loop must be over unique_index->nkeycolumns, rather than columns. It shouldn’t include the extra non-key columns. This can currently lead to invalid memory accesses as well a few lines later when it does an array access of unique_index->opfamily[c] – this array only has nkeycolumns entries.

 

-Floris

 

 

From: Andy Fan <zhihui.fan1213@gmail.com>
Sent: Sunday 19 July 2020 5:03 AM
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>; PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>; Tom Lane <tgl@sss.pgh.pa.us>; Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>; rushabh.lathia@gmail.com
Subject: Re: [PATCH] Keeps tracking the uniqueness with UniqueKey [External]

 

Fixed a test case in v10. 

 

--

Best Regards

Andy Fan

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

Предыдущее
От: Soumyadeep Chakraborty
Дата:
Сообщение: Re: Parallel Seq Scan vs kernel read ahead
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Default setting for enable_hashagg_disk