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 ce9676a4
......@@ -63,3 +63,15 @@ pk u o
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;
......@@ -70,3 +70,39 @@ insert into t1 values (1,1,1);
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;
......@@ -502,10 +502,10 @@ ha_ndbcluster::invalidate_dictionary_cache(TABLE_SHARE *share, Ndb *ndb,
}
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);
}
......
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