Re: BUG #18247: Integer overflow leads to negative width - Mailing list pgsql-bugs

From RekGRpth
Subject Re: BUG #18247: Integer overflow leads to negative width
Date
Msg-id CAPgh2mKOawDQbmrtxXv_rOCSNAo4ByorMDGHdvy=Gs7ub734tw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18247: Integer overflow leads to negative width  (Richard Guo <guofenglinux@gmail.com>)
Responses Re: BUG #18247: Integer overflow leads to negative width
List pgsql-bugs
How bad would it be if, after overflowing, the width value was within
the allowed range?

пт, 15 дек. 2023 г. в 07:28, Richard Guo <guofenglinux@gmail.com>:
>
>
> 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 by date:

Previous
From: Richard Guo
Date:
Subject: Re: BUG #18247: Integer overflow leads to negative width
Next
From: Tom Lane
Date:
Subject: Re: BUG #18247: Integer overflow leads to negative width