diff options
author | unknown <ibabaev@bk-internal.mysql.com> | 2007-04-21 03:51:51 +0200 |
---|---|---|
committer | unknown <ibabaev@bk-internal.mysql.com> | 2007-04-21 03:51:51 +0200 |
commit | 4272dbeda652facc0cf648bcb03d194ca2217f1b (patch) | |
tree | 5e91b6d0d690caff10269306cb28b3d6b1a236d9 /sql/sql_show.cc | |
parent | 51e016f1845b962a705af589aa7af599462c1743 (diff) | |
parent | f335e7e4bbbcedd4e3e5b6b10b661472db960381 (diff) | |
download | mariadb-git-4272dbeda652facc0cf648bcb03d194ca2217f1b.tar.gz |
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-opt
sql/item_cmpfunc.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_view.cc:
Auto merged
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 0a04ba3e8cf..b28077300f3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2733,18 +2733,32 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) res= open_normal_and_derived_tables(thd, show_table_list, MYSQL_LOCK_IGNORE_FLUSH); lex->sql_command= save_sql_command; - /* - We should use show_table_list->alias instead of - show_table_list->table_name because table_name - could be changed during opening of I_S tables. It's safe - to use alias because alias contains original table name - in this case. + /* + They can drop table after table names list creation and + before table opening. We open non existing table and + get ER_NO_SUCH_TABLE error. In this case we do not store + the record into I_S table and clear error. */ - res= schema_table->process_table(thd, show_table_list, table, - res, orig_base_name, - show_table_list->alias); - close_tables_for_reopen(thd, &show_table_list); - DBUG_ASSERT(!lex->query_tables_own_last); + if (thd->net.last_errno == ER_NO_SUCH_TABLE) + { + res= 0; + thd->clear_error(); + } + else + { + /* + We should use show_table_list->alias instead of + show_table_list->table_name because table_name + could be changed during opening of I_S tables. It's safe + to use alias because alias contains original table name + in this case. + */ + res= schema_table->process_table(thd, show_table_list, table, + res, orig_base_name, + show_table_list->alias); + close_tables_for_reopen(thd, &show_table_list); + DBUG_ASSERT(!lex->query_tables_own_last); + } if (res) goto err; } |