diff options
author | vva@eagle.mysql.r18.ru <> | 2004-04-01 22:47:09 +0500 |
---|---|---|
committer | vva@eagle.mysql.r18.ru <> | 2004-04-01 22:47:09 +0500 |
commit | 7a580ce991dca7d0cf950c61b2b8d7796641788a (patch) | |
tree | 97f888ec2a178d85bbfa05fcfe5f91a1282adfbb /sql/sql_rename.cc | |
parent | 3bfbe6e0dd88d190c0f97720f6ee3ad80d113410 (diff) | |
download | mariadb-git-7a580ce991dca7d0cf950c61b2b8d7796641788a.tar.gz |
fixed
BUG #2397 "RENAME TABLES is not blocked by FLUSH TABLES WITH READ LOCK"
(added waiting for global_read_lock in mysql_rename_tables)
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r-- | sql/sql_rename.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 6cff90ff613..7793e7236c0 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -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); } |