From 363094f6e71ac7f3f76c1d1a9d07da9cc5a9431b Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 28 Oct 2011 11:23:30 +0400 Subject: [PATCH 1/2] Make innodb_no_mrricp.test to really run with MRR and ICP turned OFF. --- mysql-test/r/innodb_no_mrricp.result | 8 ++++---- mysql-test/t/innodb_no_mrricp.test | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/innodb_no_mrricp.result b/mysql-test/r/innodb_no_mrricp.result index 4fd07fe9444..df0045ae6b1 100644 --- a/mysql-test/r/innodb_no_mrricp.result +++ b/mysql-test/r/innodb_no_mrricp.result @@ -1,5 +1,5 @@ set @innodb_with_mrricp=@@optimizer_switch; -set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +set optimizer_switch='mrr=off,mrr_sort_keys=off,index_condition_pushdown=off'; set @innodb_test_dont_touch_optimizer_switch=1; set @innodb_test_tmp=@@optimizer_switch; set optimizer_switch = @@ -1303,7 +1303,7 @@ count(*) 623 explain select * from t1 where c between 1 and 2500; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range c c 5 NULL # Using index condition; Rowid-ordered scan +1 SIMPLE t1 range c c 5 NULL # Using where update t1 set c=a; explain select * from t1 where c between 1 and 2500; id select_type table type possible_keys key key_len ref rows Extra @@ -1998,7 +1998,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 # Using index condition +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 @@ -2174,7 +2174,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref v v 303 const # 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 # Using index condition +1 SIMPLE t1 ref v v 303 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 diff --git a/mysql-test/t/innodb_no_mrricp.test b/mysql-test/t/innodb_no_mrricp.test index df0a3e44de5..e81d5207249 100644 --- a/mysql-test/t/innodb_no_mrricp.test +++ b/mysql-test/t/innodb_no_mrricp.test @@ -1,6 +1,6 @@ set @innodb_with_mrricp=@@optimizer_switch; -set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +set optimizer_switch='mrr=off,mrr_sort_keys=off,index_condition_pushdown=off'; set @innodb_test_dont_touch_optimizer_switch=1; --source t/innodb.test From 3694bb90a47feb463c5a38543650f0f53d1735eb Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Fri, 28 Oct 2011 12:38:36 +0400 Subject: [PATCH 2/2] - Let t/myisam_icp.test run include/icp_tests.inc with MRR/ICP turned ON (not OFF) - Fix the compile-time-default value of optimizer_switch printed by mysqld --help --defaults --- mysql-test/r/myisam_icp.result | 4 ++-- mysql-test/t/myisam_icp.test | 4 ++-- sql/mysqld.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/myisam_icp.result b/mysql-test/r/myisam_icp.result index b5b54e94319..a36e0b49399 100644 --- a/mysql-test/r/myisam_icp.result +++ b/mysql-test/r/myisam_icp.result @@ -1,3 +1,5 @@ +set @myisam_icp_tmp=@@optimizer_switch; +set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; # # Bug#36981 - "innodb crash when selecting for update" # @@ -221,8 +223,6 @@ FROM t3 JOIN t4 ON t4.f11 = t3.f10 f11 f10 DROP TABLE t1,t2,t3,t4; set optimizer_switch= @tmp_778434; -set @myisam_icp_tmp=@@optimizer_switch; -set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; drop table if exists t0, t1, t1i, t1m; # # BUG#826935 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed diff --git a/mysql-test/t/myisam_icp.test b/mysql-test/t/myisam_icp.test index 7bb984d815a..7e7affb1b8f 100644 --- a/mysql-test/t/myisam_icp.test +++ b/mysql-test/t/myisam_icp.test @@ -2,11 +2,11 @@ # ICP/MyISAM tests (Index Condition Pushdown) # ---source include/icp_tests.inc - set @myisam_icp_tmp=@@optimizer_switch; set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on'; +--source include/icp_tests.inc + --disable_warnings drop table if exists t0, t1, t1i, t1m; --enable_warnings diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 57c2fa42ab8..a7199a4af2a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -481,7 +481,7 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on," "index_merge_sort_union=on," "index_merge_intersection=on," "index_merge_sort_intersection=off," - "index_condition_pushdown=on," + "index_condition_pushdown=off," "derived_merge=off," "derived_with_keys=off," "firstmatch=off,"