forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4019285
committed
Detect more overflows in timestamp[tz]_pl_interval.
In commit25cd2d6 I (tgl) opined that "The additions of the monthsand microseconds fields could also overflow, of course. However,I believe we need no additional checks there; the existing rangechecks should catch such cases". This is demonstrably wrong howeverfor the microseconds field, and given that discovery it seems prudentto be paranoid about the months addition as well.Report and patch by Joseph Koshakow. As before, back-patch to allsupported branches. (However, the test case doesn't work beforev15 because we didn't allow wider-than-int32 numbers in intervalliterals. A variant test could probably be built that fits withinthat restriction, but it didn't seem worth the trouble.)Discussion:https://postgr.es/m/CAAvxfHf77sRHKoEzUw9_cMYSpbpNS2C+J_+8Dq4+0oi8iKopeA@mail.gmail.com1 parent310cd8a commit4019285
File tree
3 files changed
+22
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+22
-4
lines changedLines changed: 16 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3091 | 3091 |
| |
3092 | 3092 |
| |
3093 | 3093 |
| |
3094 |
| - | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
3095 | 3098 |
| |
3096 | 3099 |
| |
3097 | 3100 |
| |
| |||
3143 | 3146 |
| |
3144 | 3147 |
| |
3145 | 3148 |
| |
3146 |
| - | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
| 3152 | + | |
3147 | 3153 |
| |
3148 | 3154 |
| |
3149 | 3155 |
| |
| |||
3233 | 3239 |
| |
3234 | 3240 |
| |
3235 | 3241 |
| |
3236 |
| - | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
3237 | 3246 |
| |
3238 | 3247 |
| |
3239 | 3248 |
| |
| |||
3292 | 3301 |
| |
3293 | 3302 |
| |
3294 | 3303 |
| |
3295 |
| - | |
| 3304 | + | |
| 3305 | + | |
| 3306 | + | |
| 3307 | + | |
3296 | 3308 |
| |
3297 | 3309 |
| |
3298 | 3310 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
484 | 484 |
| |
485 | 485 |
| |
486 | 486 |
| |
| 487 | + | |
| 488 | + | |
487 | 489 |
| |
488 | 490 |
| |
489 | 491 |
| |
| |||
746 | 748 |
| |
747 | 749 |
| |
748 | 750 |
| |
| 751 | + | |
| 752 | + | |
749 | 753 |
| |
750 | 754 |
| |
751 | 755 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
| 124 | + | |
124 | 125 |
| |
125 | 126 |
| |
126 | 127 |
| |
| |||
153 | 154 |
| |
154 | 155 |
| |
155 | 156 |
| |
| 157 | + | |
156 | 158 |
| |
157 | 159 |
| |
158 | 160 |
| |
|
0 commit comments
Comments
(0)