summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_time.result
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-12-16 15:33:13 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-12-16 15:33:13 +0400
commit357cb12d87aa9d6abcf345b7221cf58d01203cdf (patch)
tree7d1065d4a65e6cbb8223a36376e9f6495e14c19f /mysql-test/r/func_time.result
parent5257d71e0e495216162b790efc6866027aa2b718 (diff)
downloadmariadb-git-357cb12d87aa9d6abcf345b7221cf58d01203cdf.tar.gz
DEV-7221 from_days fails after null value
Diffstat (limited to 'mysql-test/r/func_time.result')
-rw-r--r--mysql-test/r/func_time.result24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 8c156efbac1..08d46ab10fa 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -2561,3 +2561,27 @@ Warning 1292 Truncated incorrect time value: '9336:00:00'
Warning 1292 Truncated incorrect time value: '2952:00:00'
Warning 1292 Truncated incorrect time value: '2952:00:00'
DROP TABLE t1;
+#
+# MDEV-7221 from_days fails after null value
+#
+CREATE TABLE t1 (
+id INT(11) NOT NULL PRIMARY KEY,
+date1 DATE NULL DEFAULT NULL
+);
+INSERT INTO t1 VALUES (12, '2011-05-12');
+INSERT INTO t1 VALUES (13, NULL);
+INSERT INTO t1 VALUES (14, '2009-10-23');
+INSERT INTO t1 VALUES (15, '2014-10-30');
+INSERT INTO t1 VALUES (16, NULL);
+INSERT INTO t1 VALUES (17, NULL);
+INSERT INTO t1 VALUES (18, '2010-10-13');
+SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id;
+id date1 date2 DATE_ADD(a.date1,INTERVAL -10 DAY) TO_DAYS(a.date1)-10
+12 2011-05-12 2011-05-02 2011-05-02 734624
+13 NULL NULL NULL NULL
+14 2009-10-23 2009-10-13 2009-10-13 734058
+15 2014-10-30 2014-10-20 2014-10-20 735891
+16 NULL NULL NULL NULL
+17 NULL NULL NULL NULL
+18 2010-10-13 2010-10-03 2010-10-03 734413
+DROP TABLE t1;