summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
committerunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
commit039168c2fa724b9ed87ce2f19a7ea20acbd8a1de (patch)
tree8972ae3c8dffff8f3b6f27565d191af346c9ac8d /sql/sql_parse.cc
parentfe245ed8ba1258e1f3920e449338ea92e3a3a96e (diff)
parentf631b361b6119fb73df38602ad58e140848f92d7 (diff)
downloadmariadb-git-039168c2fa724b9ed87ce2f19a7ea20acbd8a1de.tar.gz
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-5.1-TDC mysql-test/r/variables.result: Auto merged mysql-test/t/variables.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/key.cc: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/parse_file.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/field.cc: Merge with global tree sql/sql_base.cc: Merge with global tree sql/table.cc: Merge with global tree
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 74e4b094bbe..07535bd6c27 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
@@ -6202,12 +6203,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 */
{