summaryrefslogtreecommitdiff
path: root/mysql-test/r/myisam_mrr.result
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-11-22 18:04:38 +0100
committerSergei Golubchik <sergii@pisem.net>2011-11-22 18:04:38 +0100
commitd2755a2c9c109ddb4e2e0c9feda89431a6c4fd50 (patch)
treec6e4678908c750d7f558e98cedc349aa1d350892 /mysql-test/r/myisam_mrr.result
parentaf32b02c06f32a89dc9f52e556bc5dd3bf49c19e (diff)
parent42221abaed700f6dc5d280b462755851780e8487 (diff)
downloadmariadb-git-d2755a2c9c109ddb4e2e0c9feda89431a6c4fd50.tar.gz
5.3->5.5 merge
Diffstat (limited to 'mysql-test/r/myisam_mrr.result')
-rw-r--r--mysql-test/r/myisam_mrr.result61
1 files changed, 54 insertions, 7 deletions
diff --git a/mysql-test/r/myisam_mrr.result b/mysql-test/r/myisam_mrr.result
index d3d6366456b..a85fb97fdbc 100644
--- a/mysql-test/r/myisam_mrr.result
+++ b/mysql-test/r/myisam_mrr.result
@@ -188,7 +188,7 @@ explain
select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
or c='no-such-row2');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Rowid-ordered scan
+1 SIMPLE t4 range idx1 idx1 29 NULL 10 Using index condition; Using where; Rowid-ordered scan
select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
or c='no-such-row2');
a b c filler
@@ -210,7 +210,7 @@ NULL NULL NULL NULL-1
explain
select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 range idx1 idx1 29 NULL 21 Using index condition; Rowid-ordered scan
+1 SIMPLE t4 range idx1 idx1 29 NULL 21 Using index condition; Using where; Rowid-ordered scan
select * from t4 where (a ='b-1' or a='bb-1') and b IS NULL and (c='c-1' or c='cc-2');
a b c filler
b-1 NULL c-1 NULL-15
@@ -365,7 +365,7 @@ update t1 set b=repeat(char(65+a), 20) where a < 25;
This must show range + using index condition:
explain select * from t1 where a < 10 and b = repeat(char(65+a), 20);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 19 Using where
+1 SIMPLE t1 range a a 5 NULL 19 Using index condition; Using where
select * from t1 where a < 10 and b = repeat(char(65+a), 20);
a b filler
0 AAAAAAAAAAAAAAAAAAAA filler
@@ -488,6 +488,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
t1 AS table2, t1 AS table3
@@ -496,7 +504,7 @@ table3.col_varchar_key = table2.col_varchar_key AND
table3.col_varchar_key = table2.col_varchar_nokey AND
table3.pk<>0;
COUNT(*)
-50
+200
EXPLAIN SELECT COUNT(*)
FROM
t1 AS table2, t1 AS table3
@@ -505,9 +513,48 @@ table3.col_varchar_key = table2.col_varchar_key AND
table3.col_varchar_key = table2.col_varchar_nokey AND
table3.pk<>0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE table2 ALL col_varchar_key NULL NULL NULL 20 Using where
-1 SIMPLE table3 ref PRIMARY,col_varchar_key col_varchar_key 3 test.table2.col_varchar_key 3 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE table2 ALL col_varchar_key NULL NULL NULL 40 Using where
+1 SIMPLE table3 ref PRIMARY,col_varchar_key col_varchar_key 3 test.table2.col_varchar_key 5 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
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;
+#
+# BUG#730133: Wrong result with jkl = 7, BKA, ICP in maria-5.3 + compound index
+#
+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;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL f4 10 NULL 12 Using index
+1 SIMPLE alias3 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE alias2 ref f4 f4 5 test.alias3.f5 2 Using index condition(BKA); Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+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;
+COUNT(alias2.f2)
+768
+set @@join_cache_level= @tmp_730133_jcl;
+set @@optimizer_switch= @tmp_730133_os;
+drop table t1;
+set optimizer_switch= @myisam_mrr_tmp;