summaryrefslogtreecommitdiff
path: root/mysql-test/r/delete.result
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-10-27 18:08:50 +0500
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-10-27 18:08:50 +0500
commitd2c90fcb8ecee24d68df83c83a70c0a8b8ab77c8 (patch)
treefd0ff9082aaef6ec7dec1429a9a98deb31c903da /mysql-test/r/delete.result
parent5decebc5f3aa6fc2584f6fcbd81ab7e42b63ede5 (diff)
downloadmariadb-git-d2c90fcb8ecee24d68df83c83a70c0a8b8ab77c8.tar.gz
Fix for bug #23412: delete rows with null date field
Backport of the fix for bug #8143: A date with value 0 is treated as a NULL value mysql-test/r/delete.result: Fix for bug #23412: delete rows with null date field - test result mysql-test/t/delete.test: Fix for bug #23412: delete rows with null date field - test case sql/sql_delete.cc: Fix for bug #23412: delete rows with null date field - during SELECT queries processing we convert 'date[time]_field is null' conditions into 'date[time]_field = 0000-00-00[ 00:00:00]' for not null DATE and DATETIME fields. To be consistent, we have to do the same for DELETE queries. So we should call remove_eq_conds() in the mysql_delete() as well. Also it may simplify and speed up DELETE queries execution.
Diffstat (limited to 'mysql-test/r/delete.result')
-rw-r--r--mysql-test/r/delete.result11
1 files changed, 11 insertions, 0 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