Tighten overflow checks in tidin().

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

Commit: f7ea240aa7491b6ed2985bb50888bd432f3341df
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-03-04T01:04:35Z
Releases: 15.0
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

Files

PathChange+/−
src/backend/utils/adt/tid.c modified +21 −7
src/test/regress/expected/tid.out modified +19 −0
src/test/regress/sql/tid.sql modified +12 −0

Discussion