Fix overflow hazard in timestamp_pl_interval
Joseph Koshakow <koshy44@gmail.com>
From: Joseph Koshakow <koshy44@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-28T02:59:44Z
Lists: pgsql-hackers
Attachments
- v1-0001-Catch-overflow-when-adding-timestamp-to-interval.patch (text/x-patch) patch v1-0001
Hi all, Attached is a patch that fixes some overflow/underflow hazards in `timestamp_pl_interval`. The microseconds overflow could produce incorrect result. The month overflow would generally still result in an error from the timestamp month field being too low, but it's still better to catch it early. I couldn't find any existing timestamp plus interval tests so I stuck a new tests in `timestamp.sql`. If there's a better place, then please let me know. Thanks, Joe Koshakow
Commits
-
Detect more overflows in timestamp[tz]_pl_interval.
- e6e3ee5b7e23 15.7 landed
- cb0ccefa03d3 12.19 landed
- 440b6251b752 13.15 landed
- 4019285c0640 17.0 landed
- 3752e3d21028 16.3 landed
- 1748379b6361 14.12 landed