You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.us
Copy file name to clipboardExpand all lines: src/test/regress/expected/interval.out
+35
Original file line number
Diff line number
Diff line change
@@ -908,6 +908,41 @@ select interval 'P0002' AS "year only",
908
908
2 years | 2 years 10 mons | 2 years 10 mons 15 days | 2 years 00:00:01 | 2 years 10 mons 00:00:01 | 2 years 10 mons 15 days 00:00:01 | 10:00:00 | 10:30:00
909
909
(1 row)
910
910
911
+
-- Check handling of fractional fields in ISO8601 format.
912
+
select interval 'P1Y0M3DT4H5M6S';
913
+
interval
914
+
------------------------
915
+
1 year 3 days 04:05:06
916
+
(1 row)
917
+
918
+
select interval 'P1.0Y0M3DT4H5M6S';
919
+
interval
920
+
------------------------
921
+
1 year 3 days 04:05:06
922
+
(1 row)
923
+
924
+
select interval 'P1.1Y0M3DT4H5M6S';
925
+
interval
926
+
------------------------------
927
+
1 year 1 mon 3 days 04:05:06
928
+
(1 row)
929
+
930
+
select interval 'P1.Y0M3DT4H5M6S';
931
+
interval
932
+
------------------------
933
+
1 year 3 days 04:05:06
934
+
(1 row)
935
+
936
+
select interval 'P.1Y0M3DT4H5M6S';
937
+
interval
938
+
-----------------------
939
+
1 mon 3 days 04:05:06
940
+
(1 row)
941
+
942
+
select interval 'P.Y0M3DT4H5M6S'; -- error
943
+
ERROR: invalid input syntax for type interval: "P.Y0M3DT4H5M6S"
944
+
LINE 1: select interval 'P.Y0M3DT4H5M6S';
945
+
^
911
946
-- test a couple rounding cases that changed since 8.3 w/ HAVE_INT64_TIMESTAMP.
0 commit comments