From 3cbfd4d93124f221b37d54cb9ae6f74ba3a58b67 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 14:48:11 +0300 Subject: [PATCH] Fix test results to account for difference between release BDB, debug BDB and MyISAM. mysql-test/t/bdb.test: Fix test results to account for difference in results caused by different FP calculation results between release BDB and debug BDB --- mysql-test/include/varchar.inc | 20 +++++++++++++++- mysql-test/r/bdb.result | 42 +++++++++++++++++----------------- mysql-test/r/distinct.result | 2 +- mysql-test/r/myisam.result | 34 +++++++++++++-------------- mysql-test/r/subselect.result | 2 +- mysql-test/t/bdb.test | 6 +++++ 6 files changed, 65 insertions(+), 41 deletions(-) diff --git a/mysql-test/include/varchar.inc b/mysql-test/include/varchar.inc index 646cc4cbdd4..060afbfb066 100644 --- a/mysql-test/include/varchar.inc +++ b/mysql-test/include/varchar.inc @@ -66,18 +66,26 @@ select count(*) from t1 where v like 'a%'; select count(*) from t1 where c like 'a%'; select count(*) from t1 where t like 'a%'; select count(*) from t1 where v like 'a %'; +# Test results differ for BDB, see comments in bdb.test +# and they are also different from MySAM test results. +--replace_column 9 # explain select count(*) from t1 where v='a '; +--replace_column 9 # explain select count(*) from t1 where c='a '; +--replace_column 9 # explain select count(*) from t1 where t='a '; +--replace_column 9 # explain select count(*) from t1 where v like 'a%'; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a '; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; --error 1062 alter table t1 add unique(v); alter table t1 add key(v); select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a'; ---replace_column 6 # +--replace_column 6 # 9 # explain select * from t1 where v='a'; # GROUP BY @@ -106,10 +114,15 @@ select count(*) from t1 where v between 'a' and 'a '; select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; select count(*) from t1 where v like 'a%'; select count(*) from t1 where v like 'a %'; +--replace_column 9 # explain select count(*) from t1 where v='a '; +--replace_column 9 # explain select count(*) from t1 where v like 'a%'; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a '; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +--replace_column 9 # explain select * from t1 where v='a'; # GROUP BY @@ -130,10 +143,15 @@ select count(*) from t1 where v between 'a' and 'a '; select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; select count(*) from t1 where v like 'a%'; select count(*) from t1 where v like 'a %'; +--replace_column 9 # explain select count(*) from t1 where v='a '; +--replace_column 9 # explain select count(*) from t1 where v like 'a%'; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a '; +--replace_column 9 # explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; +--replace_column 9 # explain select * from t1 where v='a'; # GROUP BY diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index df904b04e22..e3674486a21 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -140,13 +140,13 @@ id parent_id level 1015 102 2 explain select level from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 6 Using index +1 SIMPLE t1 ref level level 1 const X Using index explain select level,id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 6 Using index +1 SIMPLE t1 ref level level 1 const X Using index explain select level,id,parent_id from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 6 +1 SIMPLE t1 ref level level 1 const X select level,id from t1 where level=1; level id 1 1002 @@ -625,7 +625,7 @@ id parent_id level 1016 102 2 explain select level from t1 where level=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref level level 1 const 6 Using index +1 SIMPLE t1 ref level level 1 const X Using index select level,id from t1 where level=1; level id 1 1004 @@ -1412,22 +1412,22 @@ count(*) 9 explain select count(*) 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 10 Using where +1 SIMPLE t1 ref v v 13 const # Using where explain select count(*) from t1 where c='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c c 11 const 10 Using where +1 SIMPLE t1 ref c c 11 const # Using where explain select count(*) from t1 where t='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range t t 13 NULL 10 Using where +1 SIMPLE t1 range t t 13 NULL # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 11 Using where +1 SIMPLE t1 range v v 13 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 10 Using where +1 SIMPLE t1 range v v 13 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 10 Using where +1 SIMPLE t1 range v v 13 NULL # Using where alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 alter table t1 add key(v); @@ -1445,7 +1445,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_2 # 13 const 10 Using where +1 SIMPLE t1 ref v,v_2 # 13 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -1611,19 +1611,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const 10 Using where +1 SIMPLE t1 ref v v 258 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 11 Using where +1 SIMPLE t1 range v v 258 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 10 Using where +1 SIMPLE t1 range v v 258 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL 10 Using where +1 SIMPLE t1 range v v 258 NULL # Using where 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 258 const 10 Using where +1 SIMPLE t1 ref v v 258 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -1691,19 +1691,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 33 const 10 Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 11 Using where +1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 10 Using where +1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 10 Using where +1 SIMPLE t1 range v v 33 NULL # Using where 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 33 const 10 Using where +1 SIMPLE t1 ref v v 33 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 2bb9cb9fa07..1e1d6f96eb7 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -190,7 +190,7 @@ insert into t3 select * from t4; explain select distinct t1.a from t1,t3 where t1.a=t3.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary -1 SIMPLE t3 ref a a 5 test.t1.a 10 Using where; Using index; Distinct +1 SIMPLE t3 ref a a 5 test.t1.a 11 Using where; Using index; Distinct select distinct t1.a from t1,t3 where t1.a=t3.a; a 1 diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index bc79b6e4a68..1ac2f9631d7 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -683,22 +683,22 @@ count(*) 9 explain select count(*) 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 9 Using where; Using index +1 SIMPLE t1 ref v v 13 const # Using where; Using index explain select count(*) from t1 where c='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref c c 11 const 9 Using where; Using index +1 SIMPLE t1 ref c c 11 const # Using where; Using index explain select count(*) from t1 where t='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range t t 13 NULL 9 Using where +1 SIMPLE t1 range t t 13 NULL # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 10 Using where; Using index +1 SIMPLE t1 range v v 13 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 9 Using where; Using index +1 SIMPLE t1 range v v 13 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 13 NULL 9 Using where; Using index +1 SIMPLE t1 range v v 13 NULL # Using where; Using index alter table t1 add unique(v); ERROR 23000: Duplicate entry '{ ' for key 1 alter table t1 add key(v); @@ -716,7 +716,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_2 # 13 const 7 Using where +1 SIMPLE t1 ref v,v_2 # 13 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -880,19 +880,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 303 const 7 Using where; Using index +1 SIMPLE t1 ref v v 303 const # Using where; Using index explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL 8 Using where; Using index +1 SIMPLE t1 range v v 303 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL 7 Using where; Using index +1 SIMPLE t1 range v v 303 NULL # Using where; Using index explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 303 NULL 7 Using where; Using index +1 SIMPLE t1 range v v 303 NULL # Using where; Using index 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 303 const 7 Using where +1 SIMPLE t1 ref v v 303 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -960,19 +960,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 33 const 7 Using where +1 SIMPLE t1 ref v v 33 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 8 Using where +1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 7 Using where +1 SIMPLE t1 range v v 33 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 33 NULL 7 Using where +1 SIMPLE t1 range v v 33 NULL # Using where 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 33 const 7 Using where +1 SIMPLE t1 ref v v 33 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index e8929b2afdd..a425f054d5e 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1353,7 +1353,7 @@ explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index 2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index -2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1000 Using where; Using index +2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 Using where; Using index Warnings: Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` where (`test`.`t2`.`a`,(select 1 AS `Not_used` from `test`.`t1` join `test`.`t3` where ((`test`.`t1`.`b` = `test`.`t3`.`a`) and ((`test`.`t2`.`a`) = `test`.`t1`.`a`)))) insert into t1 values (3,31); diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index b319cf79ec2..af38be98151 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -42,8 +42,13 @@ update ignore t1 set id=id+1; # This will change all rows select * from t1; update ignore t1 set id=1023 where id=1010; select * from t1 where parent_id=102 order by parent_id,id; +# Here and below the differences in result are caused by difference in +# floating point calculations performed in BDB handler. +--replace_result 5 X 6 X explain select level from t1 where level=1; +--replace_result 5 X 6 X explain select level,id from t1 where level=1; +--replace_result 5 X 6 X explain select level,id,parent_id from t1 where level=1; select level,id from t1 where level=1; select level,id,parent_id from t1 where level=1; @@ -349,6 +354,7 @@ update ignore t1 set id=id+1; # This will change all rows select * from t1; update ignore t1 set id=1023 where id=1010; select * from t1 where parent_id=102; +--replace_result 5 X 6 X explain select level from t1 where level=1; select level,id from t1 where level=1; select level,id,parent_id from t1 where level=1;