From 72b7b7de245a56c796f9628d3aaa75c5de5723ba Mon Sep 17 00:00:00 2001 From: "gluh@mysql.com/eagle.(none)" <> Date: Wed, 16 May 2007 19:19:23 +0500 Subject: [PATCH] valgrind error fix --- sql/sql_show.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) 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);