diff options
| author | Dean Rasheed | 2023-10-29 15:46:04 +0000 |
|---|---|---|
| committer | Dean Rasheed | 2023-10-29 15:51:53 +0000 |
| commit | b2d55447a563036579d6777f64a7483dceeab6ea (patch) | |
| tree | 4bb29b19a118c7fac9a02d57ec080b3e87e066b6 /src/include | |
| parent | 849172ff4883d44168f96f39d3fde96d0aa34c99 (diff) | |
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
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/datatype/timestamp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/datatype/timestamp.h b/src/include/datatype/timestamp.h index ab8ccf89ca9..1a6390585c8 100644 --- a/src/include/datatype/timestamp.h +++ b/src/include/datatype/timestamp.h @@ -114,6 +114,7 @@ struct pg_itm_in * 30 days. */ #define DAYS_PER_MONTH 30 /* assumes exactly 30 days per month */ +#define DAYS_PER_WEEK 7 #define HOURS_PER_DAY 24 /* assume no daylight savings time changes */ /* |
