From b6be8fd0b8253b259c05fd6340b9c6fa89d28bda Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 May 2007 19:19:23 +0500 Subject: valgrind error fix --- sql/sql_show.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'sql/sql_show.cc') diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 94442bad188..e8107248c14 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -4546,19 +4546,23 @@ int fill_status(THD *thd, TABLE_LIST *tables, COND *cond) enum enum_var_type option_type; bool upper_case_names= (schema_table_idx != SCH_STATUS); - if (lex->option_type == OPT_GLOBAL || - schema_table_idx == SCH_GLOBAL_STATUS) + if (schema_table_idx == SCH_STATUS) + { + option_type= lex->option_type; + if (option_type == OPT_GLOBAL) + tmp1= &tmp; + else + tmp1= thd->initial_status_var; + } + else if (schema_table_idx == SCH_GLOBAL_STATUS) { option_type= OPT_GLOBAL; tmp1= &tmp; } else - { + { option_type= OPT_SESSION; - if (schema_table_idx == SCH_SESSION_STATUS) - tmp1= &thd->status_var; - else - tmp1= thd->initial_status_var; + tmp1= &thd->status_var; } pthread_mutex_lock(&LOCK_status); -- cgit v1.2.1