diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index cb2efe43615..60941b306be 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1978,7 +1978,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, uptime, (int) thread_count, (ulong) thd->query_id, (ulong) thd->status_var.long_query_count, - thd->status_var.opened_tables, refresh_version, cached_tables(), + thd->status_var.opened_tables, refresh_version, + cached_open_tables(), (uptime ? (ulonglong2double(thd->query_id) / (double) uptime) : (double) 0)); #ifdef SAFEMALLOC @@ -6169,12 +6170,16 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd, if (!table) DBUG_RETURN(0); // End of memory alias_str= alias ? alias->str : table->table.str; - if (check_table_name(table->table.str,table->table.length) || - table->db.str && check_db_name(table->db.str)) + if (check_table_name(table->table.str,table->table.length)) { my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str); DBUG_RETURN(0); } + if (table->db.str && check_db_name(table->db.str)) + { + my_error(ER_WRONG_DB_NAME, MYF(0), table->db.str); + DBUG_RETURN(0); + } if (!alias) /* Alias is case sensitive */ { |