Commit 591e088
committed
Fix portability issues in datetime parsing.
datetime.c's parsing logic has assumed that strtod() will accept
a string that looks like ".", which it does in glibc, but not on
some less-common platforms such as AIX. The result of this was
that datetime fields like "123." would be accepted on some platforms
but not others; which is a sufficiently odd case that it's not that
surprising we've heard no field complaints. But commit e39f990
extended that assumption to new places, and happened to add a test
case that exposed the platform dependency. Remove this dependency
by special-casing situations without any digits after the decimal
point.
(Again, this is in part a pre-existing bug but I don't feel a
compulsion to back-patch.)
Also, rearrange e39f990's changes in formatting.c to avoid a
Coverity complaint that we were copying an uninitialized field.
Discussion: https://postgr.es/m/1592893.1648969747@sss.pgh.pa.us1 parent f3c15cb commit 591e088
File tree
4 files changed
+132
-36
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+132
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
672 | 706 | | |
673 | 707 | | |
674 | 708 | | |
675 | 709 | | |
| 710 | + | |
676 | 711 | | |
677 | | - | |
678 | | - | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
684 | 715 | | |
685 | 716 | | |
686 | 717 | | |
| |||
1248 | 1279 | | |
1249 | 1280 | | |
1250 | 1281 | | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
1255 | 1285 | | |
1256 | 1286 | | |
1257 | 1287 | | |
| |||
2146 | 2176 | | |
2147 | 2177 | | |
2148 | 2178 | | |
2149 | | - | |
2150 | | - | |
2151 | | - | |
2152 | | - | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
2153 | 2182 | | |
2154 | 2183 | | |
2155 | 2184 | | |
| |||
3035 | 3064 | | |
3036 | 3065 | | |
3037 | 3066 | | |
3038 | | - | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
3039 | 3075 | | |
3040 | | - | |
3041 | | - | |
3042 | | - | |
3043 | | - | |
3044 | | - | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
3045 | 3082 | | |
3046 | 3083 | | |
3047 | 3084 | | |
| |||
3467 | 3504 | | |
3468 | 3505 | | |
3469 | 3506 | | |
3470 | | - | |
3471 | | - | |
3472 | | - | |
3473 | | - | |
3474 | | - | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
3475 | 3510 | | |
3476 | 3511 | | |
3477 | 3512 | | |
| |||
3650 | 3685 | | |
3651 | 3686 | | |
3652 | 3687 | | |
| 3688 | + | |
3653 | 3689 | | |
3654 | 3690 | | |
3655 | 3691 | | |
| |||
3676 | 3712 | | |
3677 | 3713 | | |
3678 | 3714 | | |
3679 | | - | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
| 3726 | + | |
| 3727 | + | |
| 3728 | + | |
3680 | 3729 | | |
3681 | 3730 | | |
3682 | 3731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4134 | 4134 | | |
4135 | 4135 | | |
4136 | 4136 | | |
4137 | | - | |
4138 | 4137 | | |
4139 | | - | |
4140 | | - | |
4141 | | - | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
4142 | 4144 | | |
4143 | 4145 | | |
4144 | 4146 | | |
| |||
4168 | 4170 | | |
4169 | 4171 | | |
4170 | 4172 | | |
4171 | | - | |
4172 | 4173 | | |
4173 | | - | |
4174 | | - | |
4175 | | - | |
| 4174 | + | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
4176 | 4180 | | |
4177 | 4181 | | |
4178 | 4182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
911 | 946 | | |
912 | 947 | | |
913 | 948 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
315 | 323 | | |
316 | 324 | | |
317 | 325 | | |
| |||
0 commit comments