From 0eaf4d8d7e879b32d5e1e0c7ecb409bc4d4cb060 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 17 Aug 2003 14:10:15 +0300 Subject: Fix mutex handling in SHOW_VARIABLES (key_buffer_size was not properly protected) Changed some non fatal myisamchk error messages to warnings myisam/myisamchk.c: Change error -> warning sql/handler.cc: Add mutex around keybuff_size usage sql/mysql_priv.h: Indentation update sql/set_var.cc: Add mutex around longlong variable usage sql/sql_parse.cc: Fix mutex handling in SHOW_VARIABLES sql/sql_show.cc: Fix mutex handling in SHOW_VARIABLES --- sql/sql_show.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d591a44accf..489635bd85f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1158,7 +1158,8 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) int mysqld_show(THD *thd, const char *wild, show_var_st *variables, - enum enum_var_type value_type) + enum enum_var_type value_type, + pthread_mutex_t *mutex) { char buff[8192]; String packet2(buff,sizeof(buff)); @@ -1171,8 +1172,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, if (send_fields(thd,field_list,1)) DBUG_RETURN(1); /* purecov: inspected */ - /* pthread_mutex_lock(&THR_LOCK_keycache); */ - pthread_mutex_lock(&LOCK_status); + pthread_mutex_lock(mutex); for (; variables->name; variables++) { if (!(wild && wild[0] && wild_case_compare(variables->name,wild))) @@ -1413,14 +1413,12 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, goto err; /* purecov: inspected */ } } - pthread_mutex_unlock(&LOCK_status); - /* pthread_mutex_unlock(&THR_LOCK_keycache); */ + pthread_mutex_unlock(&mutex); send_eof(&thd->net); DBUG_RETURN(0); err: - pthread_mutex_unlock(&LOCK_status); - /* pthread_mutex_unlock(&THR_LOCK_keycache); */ + pthread_mutex_unlock(&mutex); DBUG_RETURN(1); } -- cgit v1.2.1