1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00
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:
unknown
2004-04-01 22:47:09 +05:00
parent b26165d3a2
commit 9be599fc3d
3 changed files with 41 additions and 0 deletions

View File

@ -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);
}