- Notifications
You must be signed in to change notification settings - Fork5
Commitf2ba1e9
committed
Avoid unexpected conversion overflow in planner for distant date values.
The "date" type supports a wider range of dates than int64 timestamps do.However, there is pre-int64-timestamp code in the planner that assumes thatall date values can be converted to timestamp with impunity. Fortunately,what we really need out of the conversion is always a double (float8)value; so even when the date is out of timestamp's range it's possible toproduce a sane answer. All we need is a code path that doesn't try toforce the result into int64. Per trouble report from David Rericha.Back-patch to all supported versions. Although this is surely a cornercase, there's not much point in advertising a date range wider thantimestamp's if we will choke on such values in unexpected places.1 parent31d2efa commitf2ba1e9
3 files changed
+36
-2
lines changedLines changed: 33 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
459 | 459 |
| |
460 | 460 |
| |
461 | 461 |
| |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
462 | 495 |
| |
463 | 496 |
| |
464 | 497 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3866 | 3866 |
| |
3867 | 3867 |
| |
3868 | 3868 |
| |
3869 |
| - | |
3870 |
| - | |
| 3869 | + | |
3871 | 3870 |
| |
3872 | 3871 |
| |
3873 | 3872 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
91 | 91 |
| |
92 | 92 |
| |
93 | 93 |
| |
| 94 | + | |
| 95 | + | |
94 | 96 |
| |
95 | 97 |
| |
96 | 98 |
| |
|
0 commit comments
Comments
(0)