mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed MDEV-366: Assertion `share->reopen == 1' failed in maria_extra on DROP TABLE which is locked twice
mysql-test/suite/maria/lock.result: Added test case mysql-test/suite/maria/lock.test: Added test case sql/sql_table.cc: One can't call HA_EXTRA_FORCE_REOPEN on something that may be opened twice. It's safe to remove the call in this case as we will call HA_EXTRA_PREPARE_FOR_DROP for the table anyway. (One nice side effect is that drop is a bit faster as we are not flushing the cache to disk before the drop anymore)
This commit is contained in:
@ -27,3 +27,6 @@ i
|
|||||||
drop table t2;
|
drop table t2;
|
||||||
unlock tables;
|
unlock tables;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE t1 (i INT) ENGINE=Aria;
|
||||||
|
LOCK TABLES t1 WRITE, t1 AS t1a WRITE;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -42,3 +42,11 @@ select * from t1;
|
|||||||
drop table t2;
|
drop table t2;
|
||||||
unlock tables;
|
unlock tables;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-366: lock table twice with LOCK TABLES and then drop it
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (i INT) ENGINE=Aria;
|
||||||
|
LOCK TABLES t1 WRITE, t1 AS t1a WRITE;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -2187,7 +2187,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists,
|
|||||||
|
|
||||||
if (thd->locked_tables_mode)
|
if (thd->locked_tables_mode)
|
||||||
{
|
{
|
||||||
if (wait_while_table_is_used(thd, table->table, HA_EXTRA_FORCE_REOPEN))
|
if (wait_while_table_is_used(thd, table->table, HA_EXTRA_NOT_USED))
|
||||||
{
|
{
|
||||||
error= -1;
|
error= -1;
|
||||||
goto err;
|
goto err;
|
||||||
|
Reference in New Issue
Block a user