From bc646ee8810ae2a2342c61e2ca37320c7d8fb071 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Mon, 24 Oct 2016 20:55:26 +0000 Subject: [PATCH] MariaRocks: fix a bug in MariaDB: SHOW STATUS LIKE shows extra rows SHOW STATUS LIKE 'pattern' returned Rocksdb_XXX status variables that had SHOW_FUNC type but didn't match the pattern (for example Rocksdb_block_cache_add). Among other things, this caused MTR to assume that each testcase has damaged the execution environment. The issue was a unitialized variable and then a typo in the condition that checks if variable name matches the pattern. --- sql/sql_show.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index de284cbe39d..d48316e4047 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3394,7 +3394,7 @@ static bool show_status_array(THD *thd, const char *wild, for (; variables->name; variables++) { - bool wild_checked; + bool wild_checked= false; strnmov(prefix_end, variables->name, len); name_buffer[sizeof(name_buffer)-1]=0; /* Safety */ @@ -3460,8 +3460,8 @@ static bool show_status_array(THD *thd, const char *wild, else { if ((wild_checked || - (wild && wild[0] && wild_case_compare(system_charset_info, - name_buffer, wild))) && + !(wild && wild[0] && wild_case_compare(system_charset_info, + name_buffer, wild))) && (!cond || cond->val_int())) { const char *pos; // We assign a lot of const's