1
0
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:
monty@mysql.com
2004-02-04 09:51:13 +01:00
parent 5d7ffa49ec
commit f7e65a7620
7 changed files with 195 additions and 223 deletions

View File

@ -238,7 +238,7 @@ SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
DROP TABLE t1;
#
# Test error with
# Test problem with range optimzer and sub ranges
#
CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
@ -249,3 +249,17 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
DROP TABLE t1;
#
# Test problem with range optimization over overlapping ranges (#2448)
#
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)
);