summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-01-28 11:12:43 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-01-28 11:12:43 +0400
commite1e5ce0da242c30a744f496dfc5b5a00584d0e56 (patch)
tree4518efdf226a6225dbc7356a31a2042dfb4213a8 /sql/set_var.cc
parent94868914b84bd96ea946fc583862126ab8bda3a0 (diff)
downloadmariadb-git-e1e5ce0da242c30a744f496dfc5b5a00584d0e56.tar.gz
MDEV-5345 - Deadlock between mysql_change_user(), SHOW VARIABLES and
INSTALL PLUGIN There was mixed lock order between LOCK_plugin, LOCK_global_system_variables and LOCK_system_variables_hash. This patch ensures that write-lock on LOCK_system_variables_hash doesn't intersect with LOCK_plugin. Fixed by moving initialization/deinitialization of plugin options from plugin_add()/plugin_del() to plugin_initialize()/plugin_deinitalize(). So that plugin options are handled without protection of LOCK_plugin.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 2179f50d266..d4ca335e959 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -441,10 +441,10 @@ int mysql_del_sys_var_chain(sys_var *first)
{
int result= 0;
- /* A write lock should be held on LOCK_system_variables_hash */
-
+ mysql_rwlock_wrlock(&LOCK_system_variables_hash);
for (sys_var *var= first; var; var= var->next)
result|= my_hash_delete(&system_variable_hash, (uchar*) var);
+ mysql_rwlock_unlock(&LOCK_system_variables_hash);
return result;
}