diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-03-18 13:43:33 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-03-18 13:43:33 +0100 |
commit | 5ff5c4b8a32a74501aace277766df4c336c62157 (patch) | |
tree | 7b1bdc32928b43789b53f6795473fd7718b7e4b8 /mysql-test | |
parent | 1a963822c80ada2ea82a8a07c09870070fb6a820 (diff) | |
download | mariadb-git-5ff5c4b8a32a74501aace277766df4c336c62157.tar.gz |
lp:737111 Different behavior for TIMESTAMPADD with 0000-00-00 argument in 5.1-micro
respect fuzzydate flags in Item_*::get_date() methods
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_time.result | 11 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 10 |
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 67d14ee1c07..8f96a9ff5d9 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1501,3 +1501,14 @@ create table t1 (f1 timestamp); select * from t1 where f1 > f1 and f1 <=> timestampadd(hour, 9 , '2010-01-01 16:55:35'); f1 drop table t1; +create table t1 (f1 date); +insert into t1 values ('0000-00-00'); +select timestampadd(week, 1, f1) from t1; +timestampadd(week, 1, f1) +NULL +select timestampadd(week, 1, date("0000-00-00")); +timestampadd(week, 1, date("0000-00-00")) +NULL +Warnings: +Warning 1292 Incorrect datetime value: '0000-00-00' +drop table t1; diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 7c4c24f937d..65d347c05da 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -944,3 +944,13 @@ select now() > coalesce(time('21:43:24'), date('2010-05-03')); create table t1 (f1 timestamp); select * from t1 where f1 > f1 and f1 <=> timestampadd(hour, 9 , '2010-01-01 16:55:35'); drop table t1; + +# +# lp:737111 Different behavior for TIMESTAMPADD with 0000-00-00 argument in 5.1-micro +# +create table t1 (f1 date); +insert into t1 values ('0000-00-00'); +select timestampadd(week, 1, f1) from t1; +select timestampadd(week, 1, date("0000-00-00")); +drop table t1; + |