diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2014-12-16 15:33:13 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2014-12-16 15:33:13 +0400 |
commit | 357cb12d87aa9d6abcf345b7221cf58d01203cdf (patch) | |
tree | 7d1065d4a65e6cbb8223a36376e9f6495e14c19f /mysql-test/r | |
parent | 5257d71e0e495216162b790efc6866027aa2b718 (diff) | |
download | mariadb-git-357cb12d87aa9d6abcf345b7221cf58d01203cdf.tar.gz |
DEV-7221 from_days fails after null value
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/func_time.result | 24 |
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; |