summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2010-11-10 14:32:42 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2010-11-10 14:32:42 +0600
commitce3a7f4b01578ae00d972bdec8700349f3ed44a2 (patch)
tree881472a5bbcffe3c05195aa6935623f74e8376ec /sql
parent5b3e668af8b1bc44cd5379f425bed38809361d5f (diff)
downloadmariadb-git-ce3a7f4b01578ae00d972bdec8700349f3ed44a2.tar.gz
Fixed bug#56619 - Assertion failed during
ALTER TABLE RENAME, DISABLE KEYS. The code of ALTER TABLE RENAME, DISABLE KEYS could issue a commit while holding LOCK_open mutex. This is a regression introduced by the fix for Bug 54453. This failed an assert guarding us against a potential deadlock with connections trying to execute FLUSH TABLES WITH READ LOCK. The fix is to move acquisition of LOCK_open outside the section that issues ha_autocommit_or_rollback(). LOCK_open is taken to protect against concurrent operations with .frms and the table definition cache, and doesn't need to cover the call to commit. A test case added to innodb_mysql.test. The patch is to be null-merged to 5.5, which already has 54453 null-merged to it.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_table.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 971e1022d63..b919ea9eae7 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -6832,7 +6832,6 @@ view_err:
table->alias);
}
- 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
@@ -6853,6 +6852,7 @@ view_err:
*/
ha_autocommit_or_rollback(thd, 0);
+ VOID(pthread_mutex_lock(&LOCK_open));
/*
Then do a 'simple' rename of the table. First we need to close all
instances of 'source' table.
@@ -6885,6 +6885,8 @@ view_err:
}
}
}
+ else
+ VOID(pthread_mutex_lock(&LOCK_open));
if (error == HA_ERR_WRONG_COMMAND)
{