Re: Can rs_cindex be < 0 for bitmap heap scans? - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Can rs_cindex be < 0 for bitmap heap scans?
Date
Msg-id CAAKRu_Y_-sXq3YfZuMAm11=rqAQceUCwhb5122Lo+tq01EZdPw@mail.gmail.com
Whole thread Raw
In response to Re: Can rs_cindex be < 0 for bitmap heap scans?  (Richard Guo <guofenglinux@gmail.com>)
List pgsql-hackers
On Thu, Dec 19, 2024 at 9:36 PM Richard Guo <guofenglinux@gmail.com> wrote:
>
> On Fri, Dec 20, 2024 at 7:50 AM Melanie Plageman
> <melanieplageman@gmail.com> wrote:
> Looks correct to me.
>
> BTW, I kind of doubt that the overflow risk fixed in 28328ec87 is a
> real issue in real-world scenarios.  Is it realistically possible to
> have more than INT_MAX tuples fit on one heap page?
>
> If it is, then the statement below could also be prone to overflow.
>
>     uint32      mid = (start + end) / 2;
>
> Maybe you want to change it to:
>
>     uint32      mid = start + (end - start) / 2;

I've done this and pushed.

Thanks to you and Ranier for your help in identifying and fixing this!

- Melanie



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: pure parsers and reentrant scanners
Next
From: Tom Lane
Date:
Subject: Re: pure parsers and reentrant scanners