summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_time.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2013-09-16 14:07:01 +0400
committerAlexander Barkov <bar@mnogosearch.org>2013-09-16 14:07:01 +0400
commit5464e904b6db84cbbdc7aeb90fbb2115166d432f (patch)
tree64e54dcc5d04a8d440d3b5096594bc9100001826 /mysql-test/r/func_time.result
parent22c4a2496171416960058b3c25d2bbee3f6fc6cf (diff)
downloadmariadb-git-5464e904b6db84cbbdc7aeb90fbb2115166d432f.tar.gz
MDEV-4861 TIME/DATETIME arithmetics does not preserve INTERVAL precision
Adding tests only. The problem was earlier fixed by MDEV-4724 Some temporal functions do not preserve microseconds
Diffstat (limited to 'mysql-test/r/func_time.result')
-rw-r--r--mysql-test/r/func_time.result23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 8aba949ad55..645733a3dc0 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -2228,6 +2228,29 @@ SELECT CONVERT_TZ('2001-01-01 10:20:30.12','+00:00','+01:00');
CONVERT_TZ('2001-01-01 10:20:30.12','+00:00','+01:00')
2001-01-01 11:20:30.12
#
+# MDEV-4861 TIME/DATETIME arithmetics does not preserve INTERVAL precision
+#
+CREATE TABLE t1 (t0 TIME);
+INSERT INTO t1 VALUES ('00:00:00');
+SELECT t0 + INTERVAL 1.1 SECOND FROM t1;
+t0 + INTERVAL 1.1 SECOND
+00:00:01.1
+CREATE TABLE t2 AS SELECT t0 + INTERVAL 1.1 SECOND FROM t1;
+SHOW COLUMNS FROM t2;
+Field Type Null Key Default Extra
+t0 + INTERVAL 1.1 SECOND time(1) YES NULL
+DROP TABLE t1,t2;
+CREATE TABLE t1 (t0 DATETIME);
+INSERT INTO t1 VALUES ('2001-01-01 00:00:00');
+SELECT t0 + INTERVAL 1.1 SECOND FROM t1;
+t0 + INTERVAL 1.1 SECOND
+2001-01-01 00:00:01.1
+CREATE TABLE t2 AS SELECT t0 + INTERVAL 1.1 SECOND FROM t1;
+SHOW COLUMNS FROM t2;
+Field Type Null Key Default Extra
+t0 + INTERVAL 1.1 SECOND datetime(1) YES NULL
+DROP TABLE t1, t2;
+#
# MDEV-4843 Wrong data type for TIMESTAMP('2001-01-01','10:10:10')
#
CREATE TABLE t1 AS SELECT