Tighten overflow checks in tidin().
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| 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
- casting operand to proper type in BlockIdGetBlockNumber 16 messages · 2022-03-03