1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Added protection around usage of thd->mysys_var

(May be changed to 0 by scheduler)
This commit is contained in:
Michael Widenius
2009-11-26 22:19:33 +02:00
parent 847bab8e75
commit d210df50a2
6 changed files with 21 additions and 3 deletions

View File

@ -1747,6 +1747,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
if ((thd_info->db=tmp->db)) // Safe test
thd_info->db=thd->strdup(thd_info->db);
thd_info->command=(int) tmp->command;
pthread_mutex_lock(&tmp->LOCK_thd_data);
if ((mysys_var= tmp->mysys_var))
pthread_mutex_lock(&mysys_var->mutex);
thd_info->proc_info= (char*) (tmp->killed == THD::KILL_CONNECTION? "Killed" : 0);
@ -1766,6 +1767,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
#endif
if (mysys_var)
pthread_mutex_unlock(&mysys_var->mutex);
pthread_mutex_unlock(&tmp->LOCK_thd_data);
thd_info->start_time= tmp->start_time;
thd_info->query=0;