Guard against overflow in make_interval().
Dean Rasheed <dean.a.rasheed@gmail.com>
Guard against overflow in make_interval(). The original code did very little to guard against integer or floating point overflow when computing the interval's fields. Detect any such overflows and error out, rather than silently returning bogus results. Joseph Koshakow, reviewed by Ashutosh Bapat and me. Discussion: https://postgr.es/m/CAAvxfHcm1TPwH_zaGWuFoL8pZBestbRZTU6Z%3D-RvAdSXTPbKfg%40mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/timestamp.c | modified | +28 −11 |
| src/include/datatype/timestamp.h | modified | +1 −0 |
| src/test/regress/expected/interval.out | modified | +27 −0 |
| src/test/regress/sql/interval.sql | modified | +15 −0 |
Discussion
- Infinite Interval 104 messages · 2022-12-10 → 2023-11-18