Tighten overflow checks in tidin().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Mar 2022 01:03:47 +0000 (20:03 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 4 Mar 2022 01:04:35 +0000 (20:04 -0500)
commitf7ea240aa7491b6ed2985bb50888bd432f3341df
tree87d14901c88ddb3457c63af8264579e50b5f1188
parentb3c8aae00850384b1cec5311eb1864e2f5e80a44
Tighten overflow checks in tidin().

This code seems to have been written on the assumption that
"unsigned long" is 32 bits; or at any rate it ignored the
possibility of conversion overflow.  Rewrite, borrowing some
logic from oidin().

Discussion: https://postgr.es/m/3441768.1646343914@sss.pgh.pa.us
src/backend/utils/adt/tid.c
src/test/regress/expected/tid.out
src/test/regress/sql/tid.sql