MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:March 8 2006 1:45pm
Subject:bk commit into 5.1 tree (tomas:1.2166) BUG#17812
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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.2166 06/03/08 14:45:09 tomas@stripped +3 -0
  Bug #17812 Previous lock table for write causes "stray" lock although table is recreated
  - only set table share version to 0 (zero) on global invalidation

  sql/ha_ndbcluster.cc
    1.282 06/03/08 14:45:01 tomas@stripped +1 -1
    Bug #17812 Previous lock table for write causes "stray" lock although table is recreated
    - only set table share version to 0 (zero) on global invalidation

  mysql-test/t/ndb_lock.test
    1.8 06/03/08 14:45:01 tomas@stripped +36 -0
    Bug #17812 Previous lock table for write causes "stray" lock although table is recreated
    - only set table share version to 0 (zero) on global invalidation

  mysql-test/r/ndb_lock.result
    1.6 06/03/08 14:45:01 tomas@stripped +12 -0
    Bug #17812 Previous lock table for write causes "stray" lock although table is recreated
    - only set table share version to 0 (zero) on global invalidation

# 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:	tomas
# Host:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new

--- 1.281/sql/ha_ndbcluster.cc	2006-03-07 12:26:54 +01:00
+++ 1.282/sql/ha_ndbcluster.cc	2006-03-08 14:45:01 +01:00
@@ -502,10 +502,10 @@
     }
     else
       dict->invalidateTable(tabname);
+    share->version=0L;			/* Free when thread is ready */
   }
   else
     dict->removeCachedTable(tabname);
-  share->version=0L;			/* Free when thread is ready */
   DBUG_RETURN(0);
 }
 

--- 1.5/mysql-test/r/ndb_lock.result	2004-10-13 10:07:50 +02:00
+++ 1.6/mysql-test/r/ndb_lock.result	2006-03-08 14:45:01 +01:00
@@ -63,3 +63,15 @@
 5	5	5
 insert into t1 values (1,1,1);
 drop table t1;
+create table t3 (id2 int) engine=ndb;
+lock tables t3 write;
+unlock tables;
+id2
+drop table t3;
+create table t2 (id int, j int) engine=ndb;
+insert into t2 values (2, 2);
+create table t3 (id int) engine=ndb;
+lock tables t3 read;
+delete t2 from t2, t3 where t2.id = t3.id;
+unlock tables;
+drop table t2, t3;

--- 1.7/mysql-test/t/ndb_lock.test	2005-07-28 02:21:45 +02:00
+++ 1.8/mysql-test/t/ndb_lock.test	2006-03-08 14:45:01 +01:00
@@ -70,3 +70,39 @@
 drop table t1;
 
 # End of 4.1 tests
+
+#
+# Bug #17812 Previous lock table for write causes "stray" lock
+# although table is recreated
+#
+# this creating, locking, and dropping causes a subsequent hang
+# on the delete below waiting for table t2  the locking in the
+# "other" connection is relevant, as without it there is no problem
+#
+connection con1;
+create table t3 (id2 int) engine=ndb;
+
+connection con2;
+lock tables t3 write;
+unlock tables;
+
+connection con1;
+drop table t3;
+
+connection con1;
+create table t2 (id int, j int) engine=ndb;
+insert into t2 values (2, 2);
+create table t3 (id int) engine=ndb;
+
+connection con2;
+lock tables t3 read;
+
+connection con1;
+# here we get a hang before bugfix although we shouldn't
+delete t2 from t2, t3 where t2.id = t3.id;
+
+connection con2;
+unlock tables;
+
+connection con1;
+drop table t2, t3;
Thread
bk commit into 5.1 tree (tomas:1.2166) BUG#17812tomas8 Mar