Re: BUG #18247: Integer overflow leads to negative width

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #18247: Integer overflow leads to negative width
Дата
Msg-id CAMbWs4_8+mtt5C8EXmfHa_Hs-OW6EhEz_XjhzBk8miwg2h65CQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #18247: Integer overflow leads to negative width  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #18247: Integer overflow leads to negative width  (RekGRpth <rekgrpth@gmail.com>)
Re: BUG #18247: Integer overflow leads to negative width  (Alexander Lakhin <exclusion@gmail.com>)
Re: BUG #18247: Integer overflow leads to negative width  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

On Thu, Dec 14, 2023 at 10:43 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Richard Guo <guofenglinux@gmail.com> writes:
> On Thu, Dec 14, 2023 at 5:29 PM PG Bug reporting form <
> noreply@postgresql.org> wrote:
>> EXPLAIN SELECT * FROM t;
>> QUERY PLAN
>> ------------------------------------------------------------
>> Seq Scan on t  (cost=0.00..10.00 rows=1 width=-2113929008)
>> (1 row)

> Can we just error out when an overflow occurs?

Probably better to clamp tuple width estimates to MaxAllocSize.
Anything larger would not correspond to reality anyhow.

Fair point.  How about the attached patch?

Thanks
Richard
Вложения

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

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: [BUG] false positive in bt_index_check in case of short 4B varlena datum
Следующее
От: RekGRpth
Дата:
Сообщение: Re: BUG #18247: Integer overflow leads to negative width