diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-04-18 13:41:15 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-04-18 13:41:15 +0400 |
commit | 1c6d508a2b9dd1dfaeb68b3443212b57190950d8 (patch) | |
tree | 55284120225d0e51fbcc82abf411062b3e7bdfd9 /mysql-test/r/type_date.result | |
parent | f7a47e137b18277db676c1e241d06664594208d1 (diff) | |
parent | 8db600f951005b0b23b23dcd0ddd848303aa13ac (diff) | |
download | mariadb-git-1c6d508a2b9dd1dfaeb68b3443212b57190950d8.tar.gz |
Merge from 5.3
Diffstat (limited to 'mysql-test/r/type_date.result')
-rw-r--r-- | mysql-test/r/type_date.result | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 03b942be3f6..4e299ecf0b1 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -349,6 +349,52 @@ Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '0' SET @@timestamp=DEFAULT; # +# MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +# +SELECT CAST(TIME('-800:20:30') AS DATE); +CAST(TIME('-800:20:30') AS DATE) +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '-800:20:30' +SELECT CAST(TIME('800:20:30') AS DATE); +CAST(TIME('800:20:30') AS DATE) +0000-01-02 +SELECT CAST(TIME('33 08:20:30') AS DATE); +CAST(TIME('33 08:20:30') AS DATE) +0000-01-02 +CREATE TABLE t1 (a DATE); +INSERT INTO t1 VALUES (TIME('800:20:30')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +a +0000-01-02 +0000-01-02 +0000-00-00 +DROP TABLE t1; +CREATE PROCEDURE test5041() +BEGIN +DECLARE t TIME; +DECLARE d DATE; +SET t= TIME('800:00:00'); +SET d= t; +SELECT d; +END;| +call test5041(); +d +0000-01-02 +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +drop procedure test5041; +# # End of 5.3 tests # # |