1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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'
This commit is contained in:
Sergei Golubchik
2023-12-13 00:37:57 +01:00
parent d9cb1a2b7e
commit 736a54f49c
2 changed files with 8 additions and 8 deletions

View File

@@ -254,7 +254,7 @@ int PFS_system_variable_cache::do_materialize_all(THD *unsafe_thd)
} }
/* Release lock taken in get_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; m_materialized= true;
ret= 0; ret= 0;
@@ -354,7 +354,7 @@ int PFS_system_variable_cache::do_materialize_session(PFS_thread *pfs_thread)
} }
/* Release lock taken in get_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; m_materialized= true;
ret= 0; 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(). */ /* 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; m_materialized= true;
ret= 0; ret= 0;
@@ -458,7 +458,7 @@ int PFS_system_variable_cache::do_materialize_session(THD *unsafe_thd)
} }
/* Release lock taken in get_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; m_materialized= true;
ret= 0; 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); manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, false);
/* Release lock taken in get_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; m_materialized= true;
ret= 0; 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); manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, true);
/* Release lock taken in get_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; m_materialized= true;
ret= 0; 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); manifest(m_safe_thd, m_show_var_array.front(), status_vars, "", false, true);
/* Release lock taken in get_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; m_materialized= true;
ret= 0; ret= 0;

View File

@@ -212,7 +212,7 @@ public:
return false; return false;
/* Hold this lock to keep THD during materialization. */ /* Hold this lock to keep THD during materialization. */
mysql_mutex_lock(&thd->LOCK_thd_data); mysql_mutex_lock(&thd->LOCK_thd_kill);
return true; return true;
} }
void set_unsafe_thd(THD *unsafe_thd) { m_unsafe_thd= unsafe_thd; } void set_unsafe_thd(THD *unsafe_thd) { m_unsafe_thd= unsafe_thd; }