1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-30373 Wrong result with range access

This issue was caused by the bug fix for
MDEV-30325 Wrong result upon range query using index condition

The bug could happen in the case of several overlapping key ranges
with OR
This commit is contained in:
Monty
2023-01-11 18:12:40 +02:00
parent 17858e03a7
commit 7d1df207c4
6 changed files with 57 additions and 5 deletions

View File

@ -2520,6 +2520,15 @@ SELECT t1.b FROM t1 LEFT JOIN t2 ON t1.a = t2.pk WHERE t1.a IS NULL ORDER BY t1.
SET @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2;
--echo #
--echo # MDEV-30373 Wrong result with range access
--echo #
CREATE TABLE t1 (pk int, a int, PRIMARY KEY (pk), KEY(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,3),(2,6),(3,9);
SELECT * FROM t1 WHERE a < 8 OR ( pk BETWEEN 1 AND 5 AND a BETWEEN 7 AND 10 );
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #