Re: Avoid overflow with simplehash

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Avoid overflow with simplehash
Дата
Msg-id 1211829.1688656586@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Avoid overflow with simplehash  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: Avoid overflow with simplehash  (Andres Freund <andres@anarazel.de>)
Re: Avoid overflow with simplehash  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> See the comments:
> "Search for the first empty element."
> If the empty element is not found, startelem has PG_UINT64_MAX value,
> which do not fit in uint32.

I think the point of that assertion is exactly that we're required to
have an empty element (because max fillfactor is less than 1),
so the search should have succeeded.

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.  And I agree that declaring "i"
as int is wrong.

            regards, tom lane



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

Предыдущее
От: Önder Kalacı
Дата:
Сообщение: Re: [Patch] Use *other* indexes on the subscriber when REPLICA IDENTITY is FULL
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Add GitLab CI to PostgreSQL