mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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 commit is contained in:
@@ -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);
|
|||||||
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,
|
|||||||
}
|
}
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user