diff options
author | Georgi Kodinov <joro@sun.com> | 2009-11-19 18:26:19 +0200 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-11-19 18:26:19 +0200 |
commit | a4683e30ae7de6bd0dcb828898658b9c7366a988 (patch) | |
tree | 7ec9d67562e5292ad9cc38c0913ad76a36f441f5 /mysql-test/t/range.test | |
parent | ef564a3759cb07cc99de4fd53075bc357b45c2e5 (diff) | |
download | mariadb-git-a4683e30ae7de6bd0dcb828898658b9c7366a988.tar.gz |
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().
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r-- | mysql-test/t/range.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 3a845471cd0..736d65792c5 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -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 |