summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index d64c7a6df52..38139bdec0c 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -3628,16 +3628,17 @@ end:
@retval 1 error
*/
-static int fill_schema_table_names(THD *thd, TABLE *table,
+static int fill_schema_table_names(THD *thd, TABLE_LIST *tables,
LEX_STRING *db_name, LEX_STRING *table_name,
bool with_i_schema)
{
+ TABLE *table= tables->table;
if (with_i_schema)
{
table->field[3]->store(STRING_WITH_LEN("SYSTEM VIEW"),
system_charset_info);
}
- else
+ else if (tables->table_open_method != SKIP_OPEN_TABLE)
{
enum legacy_db_type not_used;
char path[FN_REFLEN + 1];
@@ -4199,7 +4200,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
/* SHOW TABLE NAMES command */
if (schema_table_idx == SCH_TABLE_NAMES)
{
- if (fill_schema_table_names(thd, tables->table, db_name,
+ if (fill_schema_table_names(thd, tables, db_name,
table_name, with_i_schema))
continue;
}
@@ -7498,6 +7499,8 @@ bool get_schema_tables_result(JOIN *join,
join->error= 1;
tab->read_record.table->file= table_list->table->file;
table_list->schema_table_state= executed_place;
+ if (!thd->is_error())
+ my_error(ER_UNKNOWN_ERROR, MYF(0));
break;
}
tab->read_record.table->file= table_list->table->file;
@@ -8385,7 +8388,7 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, 0, get_schema_constraints_record, 3, 4, 0,
OPTIMIZE_I_S_TABLE|OPEN_TABLE_ONLY},
{"TABLE_NAMES", table_names_fields_info, create_schema_table,
- get_all_tables, make_table_names_old_format, 0, 1, 2, 1, 0},
+ get_all_tables, make_table_names_old_format, 0, 1, 2, 1, OPTIMIZE_I_S_TABLE},
{"TABLE_PRIVILEGES", table_privileges_fields_info, create_schema_table,
fill_schema_table_privileges, 0, 0, -1, -1, 0, 0},
{"TABLE_STATISTICS", table_stats_fields_info, create_schema_table,