mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
fixed
BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" (added waiting for global_read_lock in mysql_rename_tables) mysql-test/r/rename.result: added test for BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" mysql-test/t/rename.test: added test for BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" sql/sql_rename.cc: fixed BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK" (added waiting for global_read_lock)
This commit is contained in:
@ -46,6 +46,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
if (wait_if_global_read_lock(thd,0))
|
||||
DBUG_RETURN(1);
|
||||
VOID(pthread_mutex_lock(&LOCK_open));
|
||||
if (lock_table_names(thd, table_list))
|
||||
goto err;
|
||||
@ -93,6 +95,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
|
||||
|
||||
err:
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
start_waiting_global_read_lock(thd);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user