diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/delete.result | 11 | ||||
-rw-r--r-- | mysql-test/t/delete.test | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index cb632fcd6c8..7a6af8fd905 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -176,3 +176,14 @@ create table t1 (a int); delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5; delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5; drop table t1; +create table t1(a date not null); +insert into t1 values (0); +select * from t1 where a is null; +a +0000-00-00 +delete from t1 where a is null; +select count(*) from t1; +count(*) +0 +drop table t1; +End of 4.1 tests diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index d4eb01cab23..2036b59d810 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -163,4 +163,15 @@ delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5; delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5; drop table t1; -# End of 4.1 tests +# +# Bug #8143: deleting '0000-00-00' values using IS NULL +# + +create table t1(a date not null); +insert into t1 values (0); +select * from t1 where a is null; +delete from t1 where a is null; +select count(*) from t1; +drop table t1; + +--echo End of 4.1 tests |