Commit 736a54f4 authored by Sergei Golubchik's avatar Sergei Golubchik

perfschema: use LOCK_thd_kill to "keep THD during materialization"

fixes the failure of

./mtr --ps sys_vars.gtid_slave_pos_grant sysschema.v_session_ssl_status

safe_mutex: Found wrong usage of mutex 'LOCK_thd_data' and 'LOCK_active_mi'
parent d9cb1a2b
......@@ -254,7 +254,7 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd)
}
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -354,7 +354,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
}
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -407,7 +407,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread, ui
}
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -458,7 +458,7 @@ int PFS_system_variable_cache::do_materialize_session(THD *unsafe_thd)
}
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -990,7 +990,7 @@ int PFS_status_variable_cache::do_materialize_all(THD* unsafe_thd)
manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, false);
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -1036,7 +1036,7 @@ int PFS_status_variable_cache::do_materialize_session(THD* unsafe_thd)
manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, true);
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......@@ -1078,7 +1078,7 @@ int PFS_status_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, true);
/* Release lock taken in get_THD(). */
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_data);
mysql_mutex_unlock(&m_safe_thd->LOCK_thd_kill);
m_materialized= true;
ret= 0;
......
......@@ -212,7 +212,7 @@ class Find_THD_variable : public Find_THD_Impl
return false;
/* Hold this lock to keep THD during materialization. */
mysql_mutex_lock(&thd->LOCK_thd_data);
mysql_mutex_lock(&thd->LOCK_thd_kill);
return true;
}
void set_unsafe_thd(THD *unsafe_thd) { m_unsafe_thd= unsafe_thd; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment