diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-12-05 12:33:02 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-12-05 12:33:02 -0500 |
commit | 3bb02f3e6d70687b02c6902fd6478e8c328608f8 (patch) | |
tree | 7962068cae78450246a484cf95cbe5cf2e37382a /sql/sql_show.cc | |
parent | a4cdd20d49a5a6ca0eb7346b7b9e898ac5e7995b (diff) | |
parent | ffc0ef63164e9a121d8a02323afe32a82299171e (diff) | |
download | mariadb-git-3bb02f3e6d70687b02c6902fd6478e8c328608f8.tar.gz |
bzr merge -rtag:mariadb-10.0.15 maria/10.0
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index c6889648a09..6f1860d902d 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -17,7 +17,7 @@ /* Function with list databases, tables or fields */ -#include "sql_plugin.h" +#include "sql_plugin.h" // Includes my_global.h #include "sql_priv.h" #include "unireg.h" #include "sql_acl.h" // fill_schema_*_privileges @@ -3092,12 +3092,11 @@ static bool show_status_array(THD *thd, const char *wild, char *value=var->value; const char *pos, *end; // We assign a lot of const's - mysql_mutex_lock(&LOCK_global_system_variables); - if (show_type == SHOW_SYS) { sys_var *var= ((sys_var *) value); show_type= var->show_type(); + mysql_mutex_lock(&LOCK_global_system_variables); value= (char*) var->value_ptr(thd, value_type, &null_lex_str); charset= var->charset(thd); } @@ -3198,7 +3197,8 @@ static bool show_status_array(THD *thd, const char *wild, thd->count_cuted_fields= CHECK_FIELD_IGNORE; table->field[1]->set_notnull(); - mysql_mutex_unlock(&LOCK_global_system_variables); + if (var->type == SHOW_SYS) + mysql_mutex_unlock(&LOCK_global_system_variables); if (schema_table_store_record(thd, table)) { @@ -5322,13 +5322,10 @@ err: const char *error= thd->is_error() ? thd->get_stmt_da()->message() : ""; table->field[20]->store(error, strlen(error), cs); - if (thd->is_error()) - { - push_warning(thd, Sql_condition::WARN_LEVEL_WARN, - thd->get_stmt_da()->sql_errno(), - thd->get_stmt_da()->message()); - thd->clear_error(); - } + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + thd->get_stmt_da()->sql_errno(), + thd->get_stmt_da()->message()); + thd->clear_error(); } DBUG_RETURN(schema_table_store_record(thd, table)); @@ -5489,10 +5486,9 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS rather than in SHOW COLUMNS */ - if (thd->is_error()) - push_warning(thd, Sql_condition::WARN_LEVEL_WARN, - thd->get_stmt_da()->sql_errno(), - thd->get_stmt_da()->message()); + push_warning(thd, Sql_condition::WARN_LEVEL_WARN, + thd->get_stmt_da()->sql_errno(), + thd->get_stmt_da()->message()); thd->clear_error(); res= 0; } |