summaryrefslogtreecommitdiff
path: root/mysql-test/r/type_date.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/type_date.result')
-rw-r--r--mysql-test/r/type_date.result46
1 files changed, 45 insertions, 1 deletions
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 03b942be3f6..398f7b83bc9 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -161,7 +161,7 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (NULL);
SELECT str_to_date( '', a ) FROM t1;
str_to_date( '', a )
-0000-00-00 00:00:00
+0000-00-00 00:00:00.000000
NULL
DROP TABLE t1;
CREATE TABLE t1 (a DATE, b INT, PRIMARY KEY (a,b));
@@ -347,6 +347,50 @@ Warnings:
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '0'
+#
+# 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)
+2013-07-16
+SELECT CAST(TIME('800:20:30') AS DATE);
+CAST(TIME('800:20:30') AS DATE)
+2013-09-21
+SELECT CAST(TIME('33 08:20:30') AS DATE);
+CAST(TIME('33 08:20:30') AS DATE)
+2013-09-21
+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:
+Note 1265 Data truncated for column 'a' at row 1
+SET SQL_MODE=DEFAULT;
+SELECT * FROM t1;
+a
+2013-09-21
+2013-09-21
+2013-08-21
+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
+2013-09-21
+Warnings:
+Note 1265 Data truncated for column 'd' at row 1
+drop procedure test5041;
SET @@timestamp=DEFAULT;
#
# End of 5.3 tests