diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-04-18 12:19:51 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-04-18 12:19:51 +0400 |
commit | 8db600f951005b0b23b23dcd0ddd848303aa13ac (patch) | |
tree | 48a761aeab9aaeaecf6232407e65dc97962c8375 /mysql-test/t/type_date.test | |
parent | 13dc299a4fa50627aff42480c8e995347283e475 (diff) | |
download | mariadb-git-8db600f951005b0b23b23dcd0ddd848303aa13ac.tar.gz |
MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value
Diffstat (limited to 'mysql-test/t/type_date.test')
-rw-r--r-- | mysql-test/t/type_date.test | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 8a47d324406..7454033a83d 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -310,5 +310,33 @@ SELECT SET @@timestamp=DEFAULT; --echo # +--echo # MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +--echo # +SELECT CAST(TIME('-800:20:30') AS DATE); +SELECT CAST(TIME('800:20:30') AS DATE); +SELECT CAST(TIME('33 08:20:30') AS DATE); +CREATE TABLE t1 (a DATE); +INSERT INTO t1 VALUES (TIME('800:20:30')); +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +DROP TABLE t1; +DELIMITER |; +CREATE PROCEDURE test5041() +BEGIN + DECLARE t TIME; + DECLARE d DATE; + SET t= TIME('800:00:00'); + SET d= t; + SELECT d; +END;| +DELIMITER ;| +call test5041(); +drop procedure test5041; + + +--echo # --echo # End of 5.3 tests --echo # |