From b07d0e2a4cbec1cd45c2667c85efd51f7021e021 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Fri, 26 Jul 2013 18:48:06 -0700 Subject: [PATCH] MDEV-4786 - merge 10.0-monty - 10.0 Fixed failure of one of the test case from innodb_ext_key.test. The fact is that the innodb code may return statistical data on record per key values that is far off the real numbers. This is exactly what happened in mariadb-5.5 with this test case. Added an ANALYZE command in this test case to avoid this problem. The same change will be done in mariadb-5.5 --- mysql-test/r/innodb_ext_key.result | 6 +++++- mysql-test/t/innodb_ext_key.test | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/innodb_ext_key.result b/mysql-test/r/innodb_ext_key.result index 4a6b902e869..e4e7e44ce7c 100644 --- a/mysql-test/r/innodb_ext_key.result +++ b/mysql-test/r/innodb_ext_key.result @@ -842,6 +842,10 @@ engine=innodb; insert into t3 select a,a,a,a from t2; alter table t3 add primary key (pk1, pk2); alter table t3 add key (col1, col2); +analyze table t1,t3; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t3 analyze status OK set optimizer_switch='extended_keys=off'; explain select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; @@ -852,7 +856,7 @@ explain select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where -1 SIMPLE t3 ref PRIMARY,col1 PRIMARY 4 test.t1.a # Using where +1 SIMPLE t3 ref PRIMARY,col1 col1 8 test.t1.a,test.t1.a # Using where; Using index set optimizer_switch='extended_keys=on'; explain select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; diff --git a/mysql-test/t/innodb_ext_key.test b/mysql-test/t/innodb_ext_key.test index 36414105917..d62217dd54f 100644 --- a/mysql-test/t/innodb_ext_key.test +++ b/mysql-test/t/innodb_ext_key.test @@ -520,6 +520,7 @@ engine=innodb; insert into t3 select a,a,a,a from t2; alter table t3 add primary key (pk1, pk2); alter table t3 add key (col1, col2); +analyze table t1,t3; set optimizer_switch='extended_keys=off'; --replace_column 9 #