diff options
author | unknown <monty@mashka.mysql.fi> | 2002-12-11 12:44:50 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-12-11 12:44:50 +0200 |
commit | 2076f2b44c30b696dc953b1809994fe5db6e4857 (patch) | |
tree | 4df96cd7a221df6177e3d28bfdd4d5a4b58780a4 /sql | |
parent | 10bde0b61cbbc84f0ee4a1b6412c357f25db61e6 (diff) | |
parent | f3b563df037353a7228a30276fc5b7a49ce565b6 (diff) | |
download | mariadb-git-2076f2b44c30b696dc953b1809994fe5db6e4857.tar.gz |
Merge work:/home/bk/mysql into mashka.mysql.fi:/home/my/mysql-3.23
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_show.cc | 12 | ||||
-rw-r--r-- | sql/sql_udf.cc | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 12979f77e56..a6285cfacd0 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1025,6 +1025,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) THD *tmp; while ((tmp=it++)) { + struct st_my_thread_var *mysys_var; if ((tmp->net.vio || tmp->system_thread) && (!user || (tmp->user && !strcmp(tmp->user,user)))) { @@ -1034,12 +1035,13 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->user=thd->strdup(tmp->user ? tmp->user : (tmp->system_thread ? "system user" : "unauthenticated user")); thd_info->host=thd->strdup(tmp->host ? tmp->host : (tmp->ip ? tmp->ip : - (tmp->system_thread ? "none" : "connecting host"))); + (tmp->system_thread ? "none" : + "connecting host"))); if ((thd_info->db=tmp->db)) // Safe test thd_info->db=thd->strdup(thd_info->db); thd_info->command=(int) tmp->command; - if (tmp->mysys_var) - pthread_mutex_lock(&tmp->mysys_var->mutex); + if ((mysys_var= tmp->mysys_var)) + pthread_mutex_lock(&mysys_var->mutex); thd_info->proc_info= (char*) (tmp->killed ? "Killed" : 0); thd_info->state_info= (char*) (tmp->locked ? "Locked" : tmp->net.reading_or_writing ? @@ -1051,8 +1053,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) tmp->mysys_var && tmp->mysys_var->current_cond ? "Waiting on cond" : NullS); - if (tmp->mysys_var) - pthread_mutex_unlock(&tmp->mysys_var->mutex); + if (mysys_var) + pthread_mutex_unlock(&mysys_var->mutex); #if !defined(DONT_USE_THR_ALARM) && ! defined(SCO) if (pthread_kill(tmp->real_id,0)) diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 5705dccd8d0..82a5e5bc002 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -204,6 +204,8 @@ void udf_init() new_thd->version--; // Force close to free memory close_thread_tables(new_thd); delete new_thd; + /* Remember that we don't have a THD */ + my_pthread_setspecific_ptr(THR_THD, 0); DBUG_VOID_RETURN; } |