Thread: pgsql: Tighten overflow checks in tidin().

pgsql: Tighten overflow checks in tidin().

From
Tom Lane
Date:
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

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/tid.c       | 28 +++++++++++++++++++++-------
src/test/regress/expected/tid.out | 19 +++++++++++++++++++
src/test/regress/sql/tid.sql      | 12 ++++++++++++
3 files changed, 52 insertions(+), 7 deletions(-)