mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed problem with range optimization over overlapping ranges (#2448)
This commit is contained in:
@ -300,3 +300,16 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
|
||||
COUNT(*)
|
||||
6
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) );
|
||||
INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4);
|
||||
SELECT * FROM t1
|
||||
WHERE
|
||||
(
|
||||
( b =1 AND a BETWEEN 14 AND 21 ) OR
|
||||
( b =2 AND a BETWEEN 16 AND 18 ) OR
|
||||
( b =3 AND a BETWEEN 15 AND 19 ) OR
|
||||
(a BETWEEN 19 AND 47)
|
||||
);
|
||||
a b
|
||||
15 1
|
||||
47 1
|
||||
|
Reference in New Issue
Block a user