diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 35b947c21fb..06259ff4931 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -576,7 +576,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select min(a1) from t1 where a1 != 'KKK'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +1 SIMPLE t1 range PRIMARY PRIMARY 3 NULL 14 Using where; Using index explain select max(a3) from t1 where a2 < 2 and a3 < 'SEA'; id select_type table type possible_keys key key_len ref rows Extra @@ -621,7 +621,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref k2 k2 4 const 6 Using where; Using index +1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index 1 SIMPLE t1 index NULL PRIMARY 3 NULL 14 Using index drop table t1, t2; create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 897e2c495b3..27f4ce7f815 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -209,3 +209,13 @@ name 6 deallocate prepare stmt1; drop table t1; +create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; +prepare stmt1 from ' show table status from test like ''t1%'' '; +execute stmt1; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +show table status from test like 't1%' ; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 9 Dynamic 0 0 0 4294967295 1024 0 NULL # # # latin1_swedish_ci NULL +deallocate prepare stmt1 ; +drop table t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index a3232fb15e9..35f9b193fe4 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -194,3 +194,15 @@ execute stmt1 using @id1, @id2; select name from t1 where id=1 or id=6; deallocate prepare stmt1; drop table t1; + +# +# SHOW TABLE STATUS test +# +create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; +prepare stmt1 from ' show table status from test like ''t1%'' '; +--replace_column 12 # 13 # 14 # +execute stmt1; +--replace_column 12 # 13 # 14 # +show table status from test like 't1%' ; +deallocate prepare stmt1 ; +drop table t1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index eda3b61b2d1..0cc25c4fe6e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2938,7 +2938,7 @@ unsent_create_error: goto error; } /* grant is checked in mysqld_show_tables */ - if (select_lex->options & SELECT_DESCRIBE) + if (lex->describe) res= mysqld_extend_show_tables(thd,db, (lex->wild ? lex->wild->ptr() : NullS)); else diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c971abedfca..6fa69f050b4 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4228,13 +4228,12 @@ show_param: LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLES; lex->select_lex.db= $2; - lex->select_lex.options= 0; } | TABLE_SYM STATUS_SYM opt_db wild { LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_TABLES; - lex->select_lex.options|= SELECT_DESCRIBE; + lex->describe= DESCRIBE_EXTENDED; lex->select_lex.db= $3; } | OPEN_SYM TABLES opt_db wild @@ -4242,7 +4241,6 @@ show_param: LEX *lex= Lex; lex->sql_command= SQLCOM_SHOW_OPEN_TABLES; lex->select_lex.db= $3; - lex->select_lex.options= 0; } | ENGINE_SYM storage_engines { Lex->create_info.db_type= $2; }