diff options
Diffstat (limited to 'mysql-test/r/type_datetime.result')
-rw-r--r-- | mysql-test/r/type_datetime.result | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 317af8d6b38..d20506288ad 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -684,4 +684,44 @@ CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+ NULL Warnings: Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00' +# +# MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +# +SELECT CAST(TIME('-800:20:30') AS DATETIME); +CAST(TIME('-800:20:30') AS DATETIME) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-800:20:30' +SELECT CAST(TIME('800:20:30') AS DATETIME); +CAST(TIME('800:20:30') AS DATETIME) +0000-01-02 08:20:30 +SELECT CAST(TIME('33 08:20:30') AS DATETIME); +CAST(TIME('33 08:20:30') AS DATETIME) +0000-01-02 08:20:30 +CREATE TABLE t1 (a DATETIME); +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')); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +a +0000-01-02 08:20:30 +0000-01-02 08:20:30 +0000-00-00 00:00:00 +DROP TABLE t1; +CREATE PROCEDURE test5041() +BEGIN +DECLARE t TIME; +DECLARE dt DATETIME; +SET t= TIME('800:20:30'); +SET dt= t; +SELECT dt; +END;| +call test5041(); +dt +0000-01-02 08:20:30 +drop procedure test5041; End of 5.3 tests |