List:Commits« Previous MessageNext Message »
From:ramil Date:June 2 2006 1:35pm
Subject:bk commit into 5.0 tree (ramil:1.2165) BUG#8143
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2165 06/06/02 16:35:41 ramil@stripped +3 -0
  Fix for bug #8143: A date with value 0 is treated as a NULL value
  

  sql/sql_delete.cc
    1.175 06/06/02 16:35:31 ramil@stripped +9 -0
    Fix for bug #8143: A date with value 0 is treated as a NULL value
      - call remove_eq_conds() as there is special IS NULL handling for not null date
fields there.

  mysql-test/t/delete.test
    1.22 06/06/02 16:35:31 ramil@stripped +11 -0
    Fix for bug #8143: A date with value 0 is treated as a NULL value
      - test case

  mysql-test/r/delete.result
    1.24 06/06/02 16:35:30 ramil@stripped +10 -0
    Fix for bug #8143: A date with value 0 is treated as a NULL value
      - test result

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ramil
# Host:	myoffice.izhnet.ru
# Root:	/usr/home/ram/work/5.0.b8143

--- 1.174/sql/sql_delete.cc	2006-05-26 13:47:46 +05:00
+++ 1.175/sql/sql_delete.cc	2006-06-02 16:35:31 +05:00
@@ -91,6 +91,15 @@ bool mysql_delete(THD *thd, TABLE_LIST *
     /* Handler didn't support fast delete; Delete rows one by one */
   }
 
+  if (conds)
+  {
+    Item::cond_result result;
+    conds= remove_eq_conds(thd, conds, &result);
+    if (result == Item::COND_FALSE)             // Impossible where
+      limit= 0;
+  }
+
+
   table->used_keys.clear_all();
   table->quick_keys.clear_all();		// Can't use 'only index'
   select=make_select(table, 0, 0, conds, 0, &error);

--- 1.21/mysql-test/t/delete.test	2005-07-28 19:09:48 +05:00
+++ 1.22/mysql-test/t/delete.test	2006-06-02 16:35:31 +05:00
@@ -171,3 +171,14 @@ delete t2.*,t3.* from t1,t2,t3 where t1.
 # This should be empty
 select * from t3;
 drop table t1,t2,t3;
+
+#
+# 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;

--- 1.23/mysql-test/r/delete.result	2006-05-03 06:31:13 +05:00
+++ 1.24/mysql-test/r/delete.result	2006-06-02 16:35:30 +05:00
@@ -192,3 +192,13 @@ delete t2.*,t3.* from t1,t2,t3 where t1.
 select * from t3;
 a	b
 drop table t1,t2,t3;
+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;
Thread
bk commit into 5.0 tree (ramil:1.2165) BUG#8143ramil2 Jun