List:Internals« Previous MessageNext Message »
From:antony Date:March 10 2005 10:41pm
Subject:bk commit into 4.1 tree (acurtis:1.2103) BUG#7241
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of acurtis. When acurtis 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.2103 05/03/10 22:40:55 acurtis@stripped +3 -0
  Bug#7241
    Fix locking for multi-delete.
    Test for multi-delete locking

  sql/sql_parse.cc
    1.428 05/03/10 22:40:42 acurtis@stripped +4 -0
    Bug#7241
      Setup non-update tables for read-only

  mysql-test/t/lock.test
    1.11 05/03/10 22:40:41 acurtis@stripped +10 -0
    Bug#7241
      Test for multi-delete locking

  mysql-test/r/lock.result
    1.14 05/03/10 22:40:41 acurtis@stripped +6 -0
    Bug#7241
      Test for multi-delete locking

# 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:	acurtis
# Host:	pcgem.rdg.cyberkinetica.com
# Root:	/var/db/bk/work-acurtis/bug7241

--- 1.427/sql/sql_parse.cc	2005-02-22 21:14:48 +00:00
+++ 1.428/sql/sql_parse.cc	2005-03-10 22:40:42 +00:00
@@ -5408,6 +5408,10 @@
     my_error(ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE, MYF(0));
     DBUG_RETURN(-1);
   }
+  /* Start by setting tables to READ */
+  for (TABLE_LIST *walk= delete_tables; walk; walk= walk->next)
+    walk->lock_type= TL_READ_NO_INSERT;
+  /* Next we find out who needs to WRITE */    
   for (target_tbl= aux_tables; target_tbl; target_tbl= target_tbl->next)
   {
     (*table_count)++;

--- 1.13/mysql-test/r/lock.result	2004-02-16 08:03:21 +00:00
+++ 1.14/mysql-test/r/lock.result	2005-03-10 22:40:41 +00:00
@@ -47,3 +47,9 @@
 lock tables t1 write, t1 as t1_alias read;
 insert into t1 select index1,nr from t1 as t1_alias;
 drop table t1,t2;
+create table t1 ( a int(11) not null auto_increment, primary key(a));
+create table t2 ( a int(11) not null auto_increment, primary key(a));
+lock tables t1 write, t2 read;
+delete from t1 using t1,t2 where t1.a=t2.a;
+delete t1 from t1,t2 where t1.a=t2.a;
+drop table t1,t2;

--- 1.10/mysql-test/t/lock.test	2004-02-10 23:06:42 +00:00
+++ 1.11/mysql-test/t/lock.test	2005-03-10 22:40:41 +00:00
@@ -59,3 +59,13 @@
 lock tables t1 write, t1 as t1_alias read;
 insert into t1 select index1,nr from t1 as t1_alias;
 drop table t1,t2;
+
+#
+# Bug7241
+#
+create table t1 ( a int(11) not null auto_increment, primary key(a));
+create table t2 ( a int(11) not null auto_increment, primary key(a));
+lock tables t1 write, t2 read;
+delete from t1 using t1,t2 where t1.a=t2.a;
+delete t1 from t1,t2 where t1.a=t2.a;
+drop table t1,t2;
Thread
bk commit into 4.1 tree (acurtis:1.2103) BUG#7241antony10 Mar