From: Date: November 29 2005 12:51pm Subject: bk commit into 5.1 tree (gluh:1.1982) BUG#15224 List-Archive: http://lists.mysql.com/internals/32821 X-Bug: 15224 Message-Id: <20051129115151.9410452891C@eagle.intranet.mysql.r18.ru> Below is the list of changes that have just been committed into a local 5.1 repository of gluh. When gluh does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1982 05/11/29 15:51:40 gluh@stripped +3 -0 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. sql/sql_show.cc 1.283 05/11/29 15:49:58 gluh@stripped +8 -0 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. mysql-test/t/information_schema.test 1.63 05/11/29 15:49:58 gluh@stripped +9 -0 Bug#14387 SHOW COLUMNS doesn't work on temporary tables. Bug#15224 SHOW INDEX from temporary table doesn't work. test case mysql-test/r/information_schema.result 1.91 05/11/29 15:49:58 gluh@stripped +8 -0 Bug#14387 SHOW COLUMNS doesn't work on temporary tables. Bug#15224 SHOW INDEX from temporary table doesn't work. test result # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: gluh # Host: eagle.intranet.mysql.r18.ru # Root: /home/gluh/MySQL/Bugs/5.1.14387 --- 1.282/sql/sql_show.cc Thu Nov 24 00:47:30 2005 +++ 1.283/sql/sql_show.cc Tue Nov 29 15:49:58 2005 @@ -2117,6 +2117,13 @@ int get_all_tables(THD *thd, TABLE_LIST bool res; 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, MYSQL_LOCK_IGNORE_FLUSH); /* @@ -2136,6 +2143,7 @@ int get_all_tables(THD *thd, TABLE_LIST show_table_list->view_db.str : show_table_list->db), show_table_list->alias)); + thd->temporary_tables= 0; close_thread_tables(thd); show_table_list->table= 0; goto err; --- 1.90/mysql-test/r/information_schema.result Thu Nov 24 00:44:53 2005 +++ 1.91/mysql-test/r/information_schema.result Tue Nov 29 15:49:58 2005 @@ -1048,3 +1048,11 @@ blob 65535 65535 text 65535 65535 text 65535 32767 drop table t1; +create temporary table t1(f1 int, index(f1)); +show columns from 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; --- 1.62/mysql-test/t/information_schema.test Fri Nov 11 13:38:29 2005 +++ 1.63/mysql-test/t/information_schema.test Tue Nov 29 15:49:58 2005 @@ -738,3 +738,12 @@ create table t1(a blob, b text charset u select data_type, character_octet_length, character_maximum_length from information_schema.columns where table_name='t1'; drop table t1; + +# +# Bug #14387 SHOW COLUMNS doesn't work on temporary tables. +# Bug #15224 SHOW INDEX from temporary table doesn't work. +# +create temporary table t1(f1 int, index(f1)); +show columns from t1; +show indexes from t1; +drop table t1;