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 */