Bug#12770 DESC cannot display the info. about temporary table

Bug#14387 SHOW COLUMNS doesn't work on temporary tables.
Bug#15224 SHOW INDEX from temporary table doesn't work.
  Restore thd->temporary_tables to be able to process
  temporary tables(only for 'show index' & 'show columns').
  This should be changed when processing of temporary tables for
  I_S tables will be done.
parent 50e3a9cd
...@@ -1056,3 +1056,14 @@ where table_name="v1"; ...@@ -1056,3 +1056,14 @@ where table_name="v1";
table_type table_type
VIEW VIEW
drop view v1; drop view v1;
create temporary table t1(f1 int, index(f1));
show columns from t1;
Field Type Null Key Default Extra
f1 int(11) YES MUL NULL
describe t1;
Field Type Null Key Default Extra
f1 int(11) YES MUL NULL
show indexes from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 f1 1 f1 A NULL NULL NULL YES BTREE
drop table t1;
...@@ -748,3 +748,14 @@ drop table t1; ...@@ -748,3 +748,14 @@ drop table t1;
select table_type from information_schema.tables select table_type from information_schema.tables
where table_name="v1"; where table_name="v1";
drop view v1; drop view v1;
#
# Bug #14387 SHOW COLUMNS doesn't work on temporary tables
# Bug #15224 SHOW INDEX from temporary table doesn't work
# Bug #12770 DESC cannot display the info. about temporary table
#
create temporary table t1(f1 int, index(f1));
show columns from t1;
describe t1;
show indexes from t1;
drop table t1;
...@@ -2069,6 +2069,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) ...@@ -2069,6 +2069,13 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
bool res; bool res;
lex->all_selects_list= lsel; lex->all_selects_list= lsel;
/*
Restore thd->temporary_tables to be able to process
temporary tables(only for 'show index' & 'show columns').
This should be changed when processing of temporary tables for
I_S tables will be done.
*/
thd->temporary_tables= open_tables_state_backup.temporary_tables;
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);
/* /*
...@@ -2088,6 +2095,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) ...@@ -2088,6 +2095,7 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
show_table_list->view_db.str : show_table_list->view_db.str :
show_table_list->db), show_table_list->db),
show_table_list->alias)); show_table_list->alias));
thd->temporary_tables= 0;
close_thread_tables(thd); close_thread_tables(thd);
show_table_list->table= 0; show_table_list->table= 0;
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment