summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-08-03 09:03:11 +0400
committerAlexander Barkov <bar@mariadb.com>2018-08-03 09:03:11 +0400
commit8ae2a2dbe6fc52d40ec88c325b9a44de52f83f2f (patch)
treedab998bc81139383e654a5dc7ebfe9dad45090a8
parent89b6ce026a2bbbbd118df19da9ae9a81aabe4f65 (diff)
downloadmariadb-git-8ae2a2dbe6fc52d40ec88c325b9a44de52f83f2f.tar.gz
MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME)
This problem was earlier fixed by the patch for MDEV-15340. Adding tests only.
-rw-r--r--mysql-test/main/func_time.result9
-rw-r--r--mysql-test/main/func_time.test10
2 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index cda36932be0..8a7a990bb85 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -3559,3 +3559,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where subtime(`test`.`t1`.`a`,TIME'00:00:01') = TIME'00:00:09' and addtime(`test`.`t1`.`a`,TIME'00:00:01') <= TIME'00:00:09'
DROP TABLE t1;
+#
+# MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME)
+#
+SELECT
+LAST_DAY(TIME'00:00:00') AS c1,
+CAST(CAST(LAST_DAY(TIME'00:00:00') AS DATE) AS TIME) AS c2,
+CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3;
+c1 c2 c3
+2018-08-31 00:00:00 00:00:00
diff --git a/mysql-test/main/func_time.test b/mysql-test/main/func_time.test
index cbce3dc26bc..53cfd29dc9c 100644
--- a/mysql-test/main/func_time.test
+++ b/mysql-test/main/func_time.test
@@ -2149,3 +2149,13 @@ SELECT * FROM t1 WHERE ADDTIME(a,TIME'00:00:01')<=TIME'00:00:09';
SELECT * FROM t1 WHERE SUBTIME(a,TIME'00:00:01')=TIME'00:00:09' AND ADDTIME(a,TIME'00:00:01')<=TIME'00:00:09';
EXPLAIN EXTENDED SELECT * FROM t1 WHERE SUBTIME(a,TIME'00:00:01')=TIME'00:00:09' AND ADDTIME(a,TIME'00:00:01')<=TIME'00:00:09';
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-15363 Wrong result for CAST(LAST_DAY(TIME'00:00:00') AS TIME)
+--echo #
+
+SELECT
+ LAST_DAY(TIME'00:00:00') AS c1,
+ CAST(CAST(LAST_DAY(TIME'00:00:00') AS DATE) AS TIME) AS c2,
+ CAST(LAST_DAY(TIME'00:00:00') AS TIME) AS c3;