diff options
Diffstat (limited to 'mysql-test/t/myisam_mrr.test')
-rw-r--r-- | mysql-test/t/myisam_mrr.test | 51 |
1 files changed, 50 insertions, 1 deletions
diff --git a/mysql-test/t/myisam_mrr.test b/mysql-test/t/myisam_mrr.test index 9c4c7be4fa2..1e070ec9a34 100644 --- a/mysql-test/t/myisam_mrr.test +++ b/mysql-test/t/myisam_mrr.test @@ -199,6 +199,14 @@ INSERT INTO t1 VALUES (22,142,'b','b'),(23,3,'y','y'),(24,0,'v','v'), (25,3,'m','m'),(26,5,'z','z'),(27,9,'n','n'), (28,1,'d','d'),(29,107,'a','a'); +INSERT INTO t1 VALUES + (110,8,'v','v'),(111,8,'f','f'), (112,5,'v','v'), + (113,8,'s','s'),(114,8,'a','a'),(115,6,'p','p'), + (116,7,'z','z'),(117,2,'a','a'),(118,5,'h','h'), + (119,7,'h','h'),(120,2,'v','v'),(121,9,'v','v'), + (122,142,'b','b'),(123,3,'y','y'),(124,0,'v','v'), + (125,3,'m','m'),(126,5,'z','z'),(127,9,'n','n'), + (128,1,'d','d'),(129,107,'a','a'); SELECT COUNT(*) FROM @@ -218,6 +226,47 @@ where set join_cache_level= @save_join_cache_level; set join_buffer_size= @save_join_buffer_size; -set optimizer_switch= @myisam_mrr_tmp; drop table t1; + +--echo # +--echo # BUG#730133: Wrong result with jkl = 7, BKA, ICP in maria-5.3 + compound index +--echo # +set @tmp_730133_jcl= @@join_cache_level; +set join_cache_level = 7; + +set @tmp_730133_os= @@optimizer_switch; +set optimizer_switch= 'join_cache_hashed=off,join_cache_bka=on,index_condition_pushdown=on,optimize_join_buffer_size=on'; + +CREATE TABLE t1 (f1 int, f2 int, f3 int, f4 int, f5 int, KEY (f4,f3)); +INSERT IGNORE INTO t1 VALUES ('2','9','5','0','0'),('4','7','0','0','0'), + ('6','97','190','0','0'),('7','3','6','0','0'),('11','101','186','0','0'), + ('14','194','226','0','0'),('15','148','133','0','0'), + ('16','9','6','0','0'),('17','9','3','0','0'),('18','1','8','0','0'), + ('19','1','5','0','0'),('20','5','7','0','0'); + +explain +SELECT COUNT(alias2.f2) +FROM + t1 STRAIGHT_JOIN + t1 AS alias3 STRAIGHT_JOIN + t1 AS alias2 FORCE KEY (f4) +WHERE + alias2.f4=alias3.f5 AND + alias2.f3 > alias3.f1; + +SELECT COUNT(alias2.f2) +FROM + t1 STRAIGHT_JOIN + t1 AS alias3 STRAIGHT_JOIN + t1 AS alias2 FORCE KEY (f4) +WHERE + alias2.f4=alias3.f5 AND + alias2.f3 > alias3.f1; + +set @@join_cache_level= @tmp_730133_jcl; +set @@optimizer_switch= @tmp_730133_os; +drop table t1; + +## This must be last line in the file: +set optimizer_switch= @myisam_mrr_tmp; |