1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #48665: sql-bench's insert test fails due to wrong result

When merging ranges during calculation of the result of OR
to two range sets the current range may be obsoleted by the 
resulting merged range.
The first overlapping range can be obsoleted as well.

Fixed by moving the pointer to the first overlapping range to the
pointer of the resulting union range.
Added few comments at key places in key_or().
This commit is contained in:
Georgi Kodinov
2009-11-19 18:26:19 +02:00
parent 0927bb741f
commit 405c9310cf
3 changed files with 69 additions and 2 deletions

View File

@ -1260,4 +1260,25 @@ SELECT str_to_date('', '%Y-%m-%d');
DROP TABLE t1, t2;
--echo #
--echo # Bug #48665: sql-bench's insert test fails due to wrong result
--echo #
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a));
INSERT INTO t1 VALUES (0,0), (1,1);
--replace_column 1 @ 2 @ 3 @ 5 @ 6 @ 7 @ 8 @ 9 @ 10 @
EXPLAIN
SELECT * FROM t1 FORCE INDEX (PRIMARY)
WHERE (a>=1 AND a<=2) OR (a>=4 AND a<=5) OR (a>=0 AND a <=10);
--echo # Should return 2 rows
SELECT * FROM t1 FORCE INDEX (PRIMARY)
WHERE (a>=1 AND a<=2) OR (a>=4 AND a<=5) OR (a>=0 AND a <=10);
DROP TABLE t1;
--echo End of 5.1 tests