summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-11-19 18:26:19 +0200
committerGeorgi Kodinov <joro@sun.com>2009-11-19 18:26:19 +0200
commit405c9310cfe2cf4673f5fb66dc221016b4e92ed6 (patch)
tree7ec9d67562e5292ad9cc38c0913ad76a36f441f5 /mysql-test/t/range.test
parent0927bb741f8d4ad1ec49a9c7128414e130e3875a (diff)
downloadmariadb-git-405c9310cfe2cf4673f5fb66dc221016b4e92ed6.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.test21
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