Changeset: c9dabcee68e0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c9dabcee68e0
Modified Files:
monetdb5/modules/atoms/mtime.c
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
Branch: Mar2018
Log Message:
allow for leap seconds
diffs (52 lines):
diff --git a/monetdb5/modules/atoms/mtime.c b/monetdb5/modules/atoms/mtime.c
--- a/monetdb5/modules/atoms/mtime.c
+++ b/monetdb5/modules/atoms/mtime.c
@@ -250,7 +250,7 @@ static date DATE_MAX, DATE_MIN; /* ofte
#define MONTHDAYS(m,y) ((m) != 2 ? LEAPDAYS[m] : leapyear(y) ? 29 : 28)
#define YEARDAYS(y) (leapyear(y) ? 366 : 365)
#define DATE(d,m,y) ((m) > 0 && (m) <= 12 && (d) > 0 && (y) != 0 &&
(y) >= YEAR_MIN && (y) <= YEAR_MAX && (d) <= MONTHDAYS(m, y))
-#define TIME(h,m,s,x) ((h) >= 0 && (h) < 24 && (m) >= 0 && (m) < 60 && (s) >=
0 && (s) < 60 && (x) >= 0 && (x) < 1000)
+#define TIME(h,m,s,x) ((h) >= 0 && (h) < 24 && (m) >= 0 && (m) < 60 && (s) >=
0 && (s) <= 60 && (x) >= 0 && (x) < 1000)
#define LOWER(c) ((c) >= 'A' && (c) <= 'Z' ? (c) + 'a' - 'A' :
(c))
/*
diff --git
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
---
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
+++
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.err
@@ -28,14 +28,6 @@ stderr of test 'timestamp_with_tz_fromst
# 16:31:49 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-1703" "--port=32740"
# 16:31:49 >
-MAPI = (monetdb) /var/tmp/mtest-1703/.s.monetdb.32740
-QUERY = select cast('2015-12-08T00:46:60' as timestamp);
-ERROR = !Timestamp (2015-12-08T00:46:60) has incorrect format
-CODE = 22007
-MAPI = (monetdb) /var/tmp/mtest-30274/.s.monetdb.37685
-QUERY = select cast('2015-12-08 00:46:60' as timestamp);
-ERROR = !Timestamp (2015-12-08 00:46:60) has incorrect format
-CODE = 22007
# 16:31:49 >
# 16:31:49 > "Done."
diff --git
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
---
a/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
+++
b/sql/test/BugTracker-2016/Tests/timestamp_with_tz_fromstr.Bug-4019.stable.out
@@ -25,6 +25,18 @@ Ready.
# 16:31:49 > "mclient" "-lsql" "-ftest" "-Eutf-8" "-i" "-e"
"--host=/var/tmp/mtest-1703" "--port=32740"
# 16:31:49 >
+#select cast('2015-12-08T00:46:60' as timestamp);
+% .L2 # table_name
+% L2 # name
+% timestamp # type
+% 26 # length
+[ 2015-12-08 00:47:00.000000 ]
+#select cast('2015-12-08 00:46:60' as timestamp);
+% .L2 # table_name
+% L2 # name
+% timestamp # type
+% 26 # length
+[ 2015-12-08 00:47:00.000000 ]
# 16:31:49 >
# 16:31:49 > "Done."
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list