diff --git a/sql/mysqld.cc b/sql/mysqld.cc index dcc9aec97a6..b71a7f7c880 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5040,12 +5040,6 @@ int mysqld_main(int argc, char **argv) unireg_abort(1); } - /* - We must have LOCK_open before LOCK_global_system_variables because - LOCK_open is hold while sql_plugin.c::intern_sys_var_ptr() is called. - */ - mysql_mutex_record_order(&LOCK_open, &LOCK_global_system_variables); - create_shutdown_thread(); start_handle_manager(); diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index c127b82b3b6..fa10699ca55 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2900,6 +2900,7 @@ 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);