diff options
author | Michael Widenius <monty@askmonty.org> | 2011-02-28 19:39:30 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-02-28 19:39:30 +0200 |
commit | 3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e (patch) | |
tree | da0e622896425203d23ecdfd1bc77b57e3502edf /sql/sql_table.cc | |
parent | 869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (diff) | |
parent | f83e594218a6d19da2fa1ea2a01d860c30fe2913 (diff) | |
download | mariadb-git-3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e.tar.gz |
Merge with 5.1 to get in changes from MySQL 5.1.55
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0f1928e37dc..98de5e95da9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6958,7 +6958,6 @@ view_err: table->alias.c_ptr()); } - VOID(pthread_mutex_lock(&LOCK_open)); /* Unlike to the above case close_cached_table() below will remove ALL instances of TABLE from table cache (it will also remove table lock @@ -6976,15 +6975,10 @@ view_err: Workaround InnoDB ending the transaction when the table instance is unlocked/closed (close_cached_table below), otherwise the trx state will differ between the server and storage engine layers. - - We have to unlock LOCK_open here as otherwise we can get deadlock - in wait_if_global_readlock(). This is still safe as we have a - name lock on the table object. */ - VOID(pthread_mutex_unlock(&LOCK_open)); ha_autocommit_or_rollback(thd, 0); - VOID(pthread_mutex_lock(&LOCK_open)); + VOID(pthread_mutex_lock(&LOCK_open)); /* Then do a 'simple' rename of the table. First we need to close all instances of 'source' table. @@ -7017,6 +7011,8 @@ view_err: } } } + else + VOID(pthread_mutex_lock(&LOCK_open)); if (error == HA_ERR_WRONG_COMMAND) { |