summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorunknown <gluh@mysql.com/eagle.(none)>2007-04-19 16:49:21 +0500
committerunknown <gluh@mysql.com/eagle.(none)>2007-04-19 16:49:21 +0500
commit09db49764281b944393331d8fc8f859ab9557498 (patch)
treedb4ff3ac86a456343fc2d14ab22db6e3076979fb /sql/sql_show.cc
parent579c2bff63fb8833226d86afb6ac2eab0ead9737 (diff)
downloadmariadb-git-09db49764281b944393331d8fc8f859ab9557498.tar.gz
Bug#27499 DROP TABLE race with SHOW TABLE STATUS
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. sql/sql_show.cc: Hide error for not existing table
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc36
1 files changed, 25 insertions, 11 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 0c9ea7b0bbf..ff3f76f446c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2314,18 +2314,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;
}