summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-05-06 12:13:03 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-05-06 12:13:03 +0400
commit5506768c52965240c3defda9cf673df00c7febe1 (patch)
treed19d1fdef0aa934798d036ba71ddc74fb2677df3 /sql/sql_plugin.cc
parent2e33a2531ad9cc59b0fa35ed2067db0629b35dd1 (diff)
downloadmariadb-git-5506768c52965240c3defda9cf673df00c7febe1.tar.gz
MDEV-6083 - Assertion `! (&(&LOCK_open)->m_mutex)->count ||
! pthread_equal(pth read_self(), (&(&LOCK_open)->m_mutex)->thread)' fails in intern_sys_var_ptr on server shutdown after uninstalling TokuDB plugin at runtime This assertion was introduced by patch for MDEV-5089 to ensure proper lock order among LOCK_open and LOCK_global_system_variables: LOCK_open must not be held while acquiring LOCK_global_system_variables. intern_sys_var_ptr() may be called while freeing storage engine variables with PLUGIN_VAR_MEMALLOC flag (when destroying table share after storage engine was uninstalled). In this case LOCK_open is held, which is harmless because we need global value pointer and thus won't acquire LOCK_global_system_variables. Relaxed assertion so it is valid only for session variables.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 56f335c2359..fc856f11a89 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -2900,11 +2900,12 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock)
DBUG_ENTER("intern_sys_var_ptr");
DBUG_ASSERT(offset >= 0);
DBUG_ASSERT((uint)offset <= global_system_variables.dynamic_variables_head);
- mysql_mutex_assert_not_owner(&LOCK_open);
if (!thd)
DBUG_RETURN((uchar*) global_system_variables.dynamic_variables_ptr + offset);
+ mysql_mutex_assert_not_owner(&LOCK_open);
+
/*
dynamic_variables_head points to the largest valid offset
*/