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.
This commit is contained in:
Sergei Petrunia 2016-10-24 20:55:26 +00:00
parent 1d1b10e93c
commit bc646ee881

View file

@ -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