Commit b07d0e2a authored by Igor Babaev's avatar Igor Babaev

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
parent b3a1f420
...@@ -842,6 +842,10 @@ engine=innodb; ...@@ -842,6 +842,10 @@ engine=innodb;
insert into t3 select a,a,a,a from t2; insert into t3 select a,a,a,a from t2;
alter table t3 add primary key (pk1, pk2); alter table t3 add primary key (pk1, pk2);
alter table t3 add key (col1, col2); 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'; set optimizer_switch='extended_keys=off';
explain explain
select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a;
...@@ -852,7 +856,7 @@ explain ...@@ -852,7 +856,7 @@ explain
select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a; 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 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 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'; set optimizer_switch='extended_keys=on';
explain explain
select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a; select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a;
......
...@@ -520,6 +520,7 @@ engine=innodb; ...@@ -520,6 +520,7 @@ engine=innodb;
insert into t3 select a,a,a,a from t2; insert into t3 select a,a,a,a from t2;
alter table t3 add primary key (pk1, pk2); alter table t3 add primary key (pk1, pk2);
alter table t3 add key (col1, col2); alter table t3 add key (col1, col2);
analyze table t1,t3;
set optimizer_switch='extended_keys=off'; set optimizer_switch='extended_keys=off';
--replace_column 9 # --replace_column 9 #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment