From ea3e27ef033e5ecaefdf3332494f363d5269bccb Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 12 Dec 2004 19:54:26 +0200 Subject: Fix test results that may change from run to run Added comments (from code review on pull) mysql-test/r/heap.result: Fix results that may change from run to run mysql-test/r/ps_5merge.result: Fix wrong result mysql-test/t/heap.test: Make results predictable sql/sql_show.cc: Add comments Fixed typo --- mysql-test/r/heap.result | 2 +- mysql-test/r/ps_5merge.result | 4 ++-- mysql-test/t/heap.test | 2 ++ sql/sql_show.cc | 12 ++++++++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 7c4ce234d58..bcdb24668bb 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -622,7 +622,7 @@ qq *a *a*a * explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 13 const 7 Using where +1 SIMPLE t1 ref v v 13 const # Using where drop table t1; create table t1 (a char(10), unique using btree (a)) engine=heap; insert into t1 values ('a'); diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 9a0b0cb8b75..1eaf747e8c6 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1698,7 +1698,7 @@ t5 CREATE TABLE `t5` ( `param03` double default NULL, `const04` varchar(3) NOT NULL default '', `param04` longtext, - `const05` binary(3) NOT NULL default '', + `const05` varbinary(3) NOT NULL default '', `param05` longblob, `const06` varchar(10) NOT NULL default '', `param06` longtext, @@ -4707,7 +4707,7 @@ t5 CREATE TABLE `t5` ( `param03` double default NULL, `const04` varchar(3) NOT NULL default '', `param04` longtext, - `const05` varchar(3) NOT NULL default '', + `const05` varbinary(3) NOT NULL default '', `param05` longblob, `const06` varchar(10) NOT NULL default '', `param06` longtext, diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 31b7f997519..6353cd78d6a 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -360,6 +360,8 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' --error 1062 alter table t1 add unique(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*')); +# Number of rows is not constant for b-trees keys +--replace_column 9 # explain select * from t1 where v='a'; drop table t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 7cc746793dc..71467664085 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2135,6 +2135,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) } } } + /* + If we have information schema its always the first table and only + the first table. Reset for other tables. + */ with_i_schema= 0; } } @@ -2838,7 +2842,7 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables, } -void store_constarints(TABLE *table, const char*db, const char *tname, +void store_constraints(TABLE *table, const char*db, const char *tname, const char *key_name, uint key_len, const char *con_type, uint con_len) { @@ -2874,10 +2878,10 @@ static int get_schema_constarints_record(THD *thd, struct st_table_list *tables, continue; if (i == primary_key && !strcmp(key_info->name, primary_key_name)) - store_constarints(table, base_name, file_name, key_info->name, + store_constraints(table, base_name, file_name, key_info->name, strlen(key_info->name), "PRIMARY KEY", 11); else if (key_info->flags & HA_NOSAME) - store_constarints(table, base_name, file_name, key_info->name, + store_constraints(table, base_name, file_name, key_info->name, strlen(key_info->name), "UNIQUE", 6); } @@ -2886,7 +2890,7 @@ static int get_schema_constarints_record(THD *thd, struct st_table_list *tables, List_iterator_fast it(f_key_list); while ((f_key_info=it++)) { - store_constarints(table, base_name, file_name, f_key_info->forein_id->str, + store_constraints(table, base_name, file_name, f_key_info->forein_id->str, strlen(f_key_info->forein_id->str), "FOREIGN KEY", 11); } } -- cgit v1.2.1