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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: RekGRpth <rekgrpth@gmail.com>
Cc: Richard Guo <guofenglinux@gmail.com>, pgsql-bugs@lists.postgresql.org
Date: 2023-12-15T03:20:21Z
Lists: pgsql-bugs
RekGRpth <rekgrpth@gmail.com> writes:
> How bad would it be if, after overflowing, the width value was within
> the allowed range?

Really pretty negligible, I should think.  You might get a not-great
choice of plan.  As Richard noted, there are some Asserts you could
hit; but not in a production build.

			regards, tom lane



Commits

  1. Prevent integer overflow when forming tuple width estimates.

  2. compute_bitmap_pages' loop_count parameter should be double not int.