mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-4778: Incorrect results from Aria/MyISAM SELECT using index with prefix length on TEXT column
Backport the fix olav.sandstaa@sun.com-20101102184747-qfuntqwj021imy9r: "Fix for Bug#52660 Perf. regr. using ICP for MyISAM on range queries on an index containing TEXT" (together with further fixes in that code) into MyISAM and Aria.
This commit is contained in:
@ -78,13 +78,13 @@ insert into t2 select * from t1;
|
||||
alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10));
|
||||
explain select * from t1 where a is null and b = 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where
|
||||
explain select * from t1 where a is null and b = 2 and c=0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where
|
||||
explain select * from t1 where a is null and b = 7 and c=0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where
|
||||
explain select * from t1 where a=2 and b = 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 1 Using where
|
||||
@ -93,25 +93,25 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 12 Using where
|
||||
explain select * from t1 where (a is null or a > 0 and a < 3) and b < 5 and c=0 limit 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a,b a 5 NULL 5 Using index condition; Using where
|
||||
1 SIMPLE t1 range a,b a 5 NULL 5 Using where
|
||||
explain select * from t1 where (a is null or a = 7) and b=7 and c=0;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using index condition; Using where
|
||||
1 SIMPLE t1 ref_or_null a,b a 5 const 4 Using where
|
||||
explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where
|
||||
explain select * from t1 where a is null and b=9 or a is null and b=7 limit 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using index condition; Using where
|
||||
1 SIMPLE t1 ref a,b a 5 const 3 Using where
|
||||
explain select * from t1 where a > 1 and a < 3 limit 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using index condition
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using where
|
||||
explain select * from t1 where a is null and b=7 or a > 1 and a < 3 limit 1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a,b a 5 NULL 4 Using index condition; Using where
|
||||
1 SIMPLE t1 range a,b a 5 NULL 4 Using where
|
||||
explain select * from t1 where a > 8 and a < 9;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using index condition
|
||||
1 SIMPLE t1 range a a 5 NULL 1 Using where
|
||||
explain select * from t1 where b like "6%";
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range b b 12 NULL 1 Using where
|
||||
|
Reference in New Issue
Block a user