1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for bug#7212: information_schema: "Can't find file" errors if storage engine gone(after review)

This commit is contained in:
gluh@gluh.mysql.r18.ru
2004-12-16 16:31:36 +03:00
parent 7216594f4f
commit 6372efa7da
8 changed files with 117 additions and 14 deletions

View File

@ -2374,12 +2374,24 @@ static int get_schema_column_record(THD *thd, struct st_table_list *tables,
const char *file_name)
{
TIME time;
const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS;
LEX *lex= thd->lex;
const char *wild= lex->wild ? lex->wild->ptr() : NullS;
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_column_record");
if (res)
{
DBUG_RETURN(1);
if (lex->orig_sql_command != SQLCOM_SHOW_FIELDS)
{
/*
I.e. we are in SELECT FROM INFORMATION_SCHEMA.COLUMS
rather than in SHOW COLUMNS
*/
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
res= 0;
}
DBUG_RETURN(res);
}
TABLE *show_table= tables->table;
@ -2745,7 +2757,23 @@ static int get_schema_stat_record(THD *thd, struct st_table_list *tables,
{
CHARSET_INFO *cs= system_charset_info;
DBUG_ENTER("get_schema_stat_record");
if (!res && !tables->view)
if (res)
{
if (thd->lex->orig_sql_command != SQLCOM_SHOW_KEYS)
{
/*
I.e. we are in SELECT FROM INFORMATION_SCHEMA.STATISTICS
rather than in SHOW KEYS
*/
if (!tables->view)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
res= 0;
}
DBUG_RETURN(res);
}
else if (!tables->view)
{
TABLE *show_table= tables->table;
KEY *key_info=show_table->key_info;
@ -2868,7 +2896,15 @@ static int get_schema_constraints_record(THD *thd, struct st_table_list *tables,
const char *file_name)
{
DBUG_ENTER("get_schema_constraints_record");
if (!res && !tables->view)
if (res)
{
if (!tables->view)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
DBUG_RETURN(0);
}
else if (!tables->view)
{
List<FOREIGN_KEY_INFO> f_key_list;
TABLE *show_table= tables->table;
@ -2925,7 +2961,15 @@ static int get_schema_key_column_usage_record(THD *thd,
{
DBUG_ENTER("get_schema_key_column_usage_record");
CHARSET_INFO *cs= system_charset_info;
if (!res && !tables->view)
if (res)
{
if (!tables->view)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
thd->net.last_errno, thd->net.last_error);
thd->clear_error();
DBUG_RETURN(0);
}
else if (!tables->view)
{
List<FOREIGN_KEY_INFO> f_key_list;
TABLE *show_table= tables->table;