Commit bc646ee8 authored by Sergei Petrunia's avatar Sergei Petrunia

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.
parent 1d1b10e9
...@@ -3394,7 +3394,7 @@ static bool show_status_array(THD *thd, const char *wild, ...@@ -3394,7 +3394,7 @@ static bool show_status_array(THD *thd, const char *wild,
for (; variables->name; variables++) for (; variables->name; variables++)
{ {
bool wild_checked; bool wild_checked= false;
strnmov(prefix_end, variables->name, len); strnmov(prefix_end, variables->name, len);
name_buffer[sizeof(name_buffer)-1]=0; /* Safety */ name_buffer[sizeof(name_buffer)-1]=0; /* Safety */
...@@ -3460,8 +3460,8 @@ static bool show_status_array(THD *thd, const char *wild, ...@@ -3460,8 +3460,8 @@ static bool show_status_array(THD *thd, const char *wild,
else else
{ {
if ((wild_checked || if ((wild_checked ||
(wild && wild[0] && wild_case_compare(system_charset_info, !(wild && wild[0] && wild_case_compare(system_charset_info,
name_buffer, wild))) && name_buffer, wild))) &&
(!cond || cond->val_int())) (!cond || cond->val_int()))
{ {
const char *pos; // We assign a lot of const's const char *pos; // We assign a lot of const's
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment