mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge moonbone.local:/work/tmp_merge-5.0-mysql
into moonbone.local:/work/tmp_merge-5.1-opt-mysql
This commit is contained in:
@@ -656,3 +656,58 @@ explain select * from t1 where a not between 'b' and 'b';
|
||||
select a, hex(filler) from t1 where a not between 'b' and 'b';
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
||||
#
|
||||
# BUG#21282
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t2 (a int, key(a));
|
||||
insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
|
||||
|
||||
set @a="select * from t2 force index (a) where a NOT IN(0";
|
||||
select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
|
||||
set @a=concat(@a, ')');
|
||||
|
||||
insert into t2 values (11),(13),(15);
|
||||
|
||||
set @b= concat("explain ", @a);
|
||||
|
||||
prepare stmt1 from @b;
|
||||
execute stmt1;
|
||||
|
||||
prepare stmt1 from @a;
|
||||
execute stmt1;
|
||||
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #18165: range access for BETWEEN with a constant for the first argument
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
id int NOT NULL DEFAULT '0',
|
||||
b int NOT NULL DEFAULT '0',
|
||||
c int NOT NULL DEFAULT '0',
|
||||
INDEX idx1(b,c), INDEX idx2(c));
|
||||
|
||||
INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
|
||||
|
||||
INSERT INTO t1(b,c) VALUES (3,4), (3,4);
|
||||
|
||||
SELECT * FROM t1 WHERE b<=3 AND 3<=c;
|
||||
SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE b<=3 AND 3<=c;
|
||||
EXPLAIN SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
|
||||
|
||||
SELECT * FROM t1 WHERE 0 < b OR 0 > c;
|
||||
SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE 0 < b OR 0 > c;
|
||||
EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
# End of 5.0 tests
|
||||
|
||||
Reference in New Issue
Block a user