pgsql: Don't prematurely cram a value into a short int.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't prematurely cram a value into a short int.
Date: 2021-03-31 20:45:33
Message-ID: E1lRhiX-0003o7-EL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Don't prematurely cram a value into a short int.

Since a4d75c86b, some buildfarm members have been warning that
Assert(attnum <= MaxAttrNumber);
is useless if attnum is an AttrNumber. I'm not certain how plausible
it is that the value coming out of the bitmap could actually exceed
MaxAttrNumber, but we seem to have thought that that was possible back
in 7300a6995. Revert the intermediate variable to int so that we have
the same overflow protection as before.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c545e9524dcfcfce25c370f584b31562e8d7a4b7

Modified Files
--------------
src/backend/statistics/extended_stats.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-03-31 21:04:00 pgsql: Silence compiler warning in non-assert builds.
Previous Message Stephen Frost 2021-03-31 20:24:42 pgsql: Add a docs section for obsoleted and renamed functions and setti