Re: Making empty Bitmapsets always be NULL

Поиск
Список
Период
Сортировка
От Yuya Watari
Тема Re: Making empty Bitmapsets always be NULL
Дата
Msg-id CAJ2pMkZ5F7c_ddQpqT-89ZuE8sVV-zHsXWHcVuf=uwsGaPu-bw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Making empty Bitmapsets always be NULL  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Making empty Bitmapsets always be NULL  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Hello,

On Thu, Jun 22, 2023 at 1:43 PM David Rowley <dgrowleyml@gmail.com> wrote:
> > 3. Avoid enlargement when nwords is equal wordnum.
> >     Can save cycles when in corner cases?
>
> No, you're just introducing a bug here.  Arrays in C are zero-based,
> so "wordnum >=  a->nwords" is exactly the correct way to check if
> wordnum falls outside the bounds of the existing allocated memory. By
> changing that to "wordnum > a->nwords" we'll fail to enlarge the words
> array when it needs to be enlarged by 1 element.

I agree with David. Unfortunately, some of the regression tests failed
with the v5 patch. These failures are due to the bug introduced by the
#3 change.

--
Best regards,
Yuya Watari



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Remove deprecation warnings when compiling PG ~13 with OpenSSL 3.0~
Следующее
От: Yuya Watari
Дата:
Сообщение: Re: Making empty Bitmapsets always be NULL