forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf0d0394
committed
Fix parsing of ISO-8601 interval fields with exponential notation.
Historically we've accepted interval input like 'P.1e10D'. Thisis probably an accident of having used strtod() to do the parsing,rather than something anyone intended, but it's been that way fora long time. Commite39f990 broke this by trying to parse theinteger and fractional parts separately, without accounting forthe possibility of an exponent. In principle that coding allowedfor precise conversions of field values wider than 15 decimaldigits, but that does not seem like a goal worth sweating bulletsfor. So, rather than trying to manage an exponent on top of theexisting complexity, let's just revert to the previous coding thatused strtod() by itself. We can still improve on the old code tothe extent of allowing the value to range up to 1.0e15 rather thanonly INT_MAX. (Allowing more than that risks creating problemsdue to precision loss: the converted fractional part might haveabsolute value more than 1. Perhaps that could be dealt with insome way, but it really does not seem worth additional effort.)Per bug #17795 from Alexander Lakhin. Back-patch to v15 wherethe faulty code came in.Discussion:https://postgr.es/m/17795-748d6db3ed95d313@postgresql.org1 parentf6db76c commitf0d0394
File tree
3 files changed
+37
-38
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+37
-38
lines changedLines changed: 28 additions & 36 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3702 | 3702 |
| |
3703 | 3703 |
| |
3704 | 3704 |
| |
3705 |
| - | |
| 3705 | + | |
3706 | 3706 |
| |
3707 |
| - | |
3708 |
| - | |
3709 |
| - | |
3710 |
| - | |
3711 |
| - | |
3712 |
| - | |
3713 |
| - | |
3714 |
| - | |
3715 |
| - | |
3716 |
| - | |
3717 |
| - | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
3718 | 3721 |
| |
3719 |
| - | |
3720 |
| - | |
3721 |
| - | |
3722 |
| - | |
3723 |
| - | |
3724 |
| - | |
3725 |
| - | |
3726 |
| - | |
3727 |
| - | |
3728 |
| - | |
3729 |
| - | |
3730 |
| - | |
3731 |
| - | |
3732 |
| - | |
3733 |
| - | |
3734 |
| - | |
3735 |
| - | |
3736 |
| - | |
3737 |
| - | |
3738 |
| - | |
3739 |
| - | |
3740 |
| - | |
3741 |
| - | |
| 3722 | + | |
| 3723 | + | |
3742 | 3724 |
| |
3743 | 3725 |
| |
3744 |
| - | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
| 3729 | + | |
| 3730 | + | |
| 3731 | + | |
| 3732 | + | |
| 3733 | + | |
| 3734 | + | |
| 3735 | + | |
| 3736 | + | |
3745 | 3737 |
| |
3746 | 3738 |
| |
3747 | 3739 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
975 | 975 |
| |
976 | 976 |
| |
977 | 977 |
| |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
978 | 984 |
| |
979 | 985 |
| |
980 | 986 |
| |
| |||
1081 | 1087 |
| |
1082 | 1088 |
| |
1083 | 1089 |
| |
1084 |
| - | |
| 1090 | + | |
1085 | 1091 |
| |
1086 | 1092 |
| |
1087 | 1093 |
| |
1088 | 1094 |
| |
1089 | 1095 |
| |
1090 |
| - | |
| 1096 | + | |
1091 | 1097 |
| |
1092 | 1098 |
| |
1093 | 1099 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
328 | 328 |
| |
329 | 329 |
| |
330 | 330 |
| |
| 331 | + | |
331 | 332 |
| |
332 | 333 |
| |
333 | 334 |
| |
|
0 commit comments
Comments
(0)