Re: Avoid overflow with simplehash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoid overflow with simplehash
Дата
Msg-id 1215055.1688658408@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Avoid overflow with simplehash  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2023-07-06 11:16:26 -0400, Tom Lane wrote:
>> It does seem like we could do
>>     uint64        startelem = SH_MAX_SIZE;
>>     ...
>>     Assert(startelem < SH_MAX_SIZE);
>> which'd make it a little clearer that the expectation is for
>> startelem to have changed value.

> I guess? I find it easier to understand all-bits-set in a coredump as
> too-large than SH_MAX_SIZE, but ...

What'd help even more is a comment:

    /* We should have found an empty element */
    Assert(startelem < SH_MAX_SIZE);

            regards, tom lane



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Problems with estimating OR conditions, IS NULL on LEFT JOINs
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgindent vs. pgperltidy command-line arguments