mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -2314,6 +2314,19 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
res= open_normal_and_derived_tables(thd, show_table_list,
|
res= open_normal_and_derived_tables(thd, show_table_list,
|
||||||
MYSQL_LOCK_IGNORE_FLUSH);
|
MYSQL_LOCK_IGNORE_FLUSH);
|
||||||
lex->sql_command= save_sql_command;
|
lex->sql_command= save_sql_command;
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
if (thd->net.last_errno == ER_NO_SUCH_TABLE)
|
||||||
|
{
|
||||||
|
res= 0;
|
||||||
|
thd->clear_error();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
We should use show_table_list->alias instead of
|
We should use show_table_list->alias instead of
|
||||||
show_table_list->table_name because table_name
|
show_table_list->table_name because table_name
|
||||||
@@ -2326,6 +2339,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||||||
show_table_list->alias);
|
show_table_list->alias);
|
||||||
close_tables_for_reopen(thd, &show_table_list);
|
close_tables_for_reopen(thd, &show_table_list);
|
||||||
DBUG_ASSERT(!lex->query_tables_own_last);
|
DBUG_ASSERT(!lex->query_tables_own_last);
|
||||||
|
}
|
||||||
if (res)
|
if (res)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user