Commit 88df3aaf authored by unknown's avatar unknown

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

parent 1355dcfc
...@@ -63,3 +63,15 @@ pk u o ...@@ -63,3 +63,15 @@ pk u o
5 5 5 5 5 5
insert into t1 values (1,1,1); insert into t1 values (1,1,1);
drop table t1; 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;
...@@ -70,3 +70,39 @@ insert into t1 values (1,1,1); ...@@ -70,3 +70,39 @@ insert into t1 values (1,1,1);
drop table t1; drop table t1;
# End of 4.1 tests # 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;
...@@ -502,10 +502,10 @@ ha_ndbcluster::invalidate_dictionary_cache(TABLE_SHARE *share, Ndb *ndb, ...@@ -502,10 +502,10 @@ ha_ndbcluster::invalidate_dictionary_cache(TABLE_SHARE *share, Ndb *ndb,
} }
else else
dict->invalidateTable(tabname); dict->invalidateTable(tabname);
share->version=0L; /* Free when thread is ready */
} }
else else
dict->removeCachedTable(tabname); dict->removeCachedTable(tabname);
share->version=0L; /* Free when thread is ready */
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment