diff options
author | Igor Babaev <igor@askmonty.org> | 2011-05-29 11:09:05 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-05-29 11:09:05 -0700 |
commit | 37f3a801f30548cbcb636de8116a7fd5954dcd9c (patch) | |
tree | 76b0fb02787ca1b27a5c671155495747c79d4a32 /mysql-test/include/icp_tests.inc | |
parent | 061060eac0351ee35267bae085cc637686e21d6c (diff) | |
download | mariadb-git-37f3a801f30548cbcb636de8116a7fd5954dcd9c.tar.gz |
Backported the test case for bug 52605.
Diffstat (limited to 'mysql-test/include/icp_tests.inc')
-rw-r--r-- | mysql-test/include/icp_tests.inc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc index ebf0b7620fe..45283de1a88 100644 --- a/mysql-test/include/icp_tests.inc +++ b/mysql-test/include/icp_tests.inc @@ -403,6 +403,41 @@ SELECT * FROM t2; DROP TABLE t1, t2; --echo # +--echo # Bug#52605 - "Adding LIMIT 1 clause to query with complex range +--echo # predicate causes wrong results" +--echo # + +CREATE TABLE t1 ( + pk INT NOT NULL, + c1 INT, + PRIMARY KEY (pk), + KEY k1 (c1) +); + +INSERT INTO t1 VALUES (1,NULL); +INSERT INTO t1 VALUES (2,6); +INSERT INTO t1 VALUES (3,NULL); +INSERT INTO t1 VALUES (4,6); +INSERT INTO t1 VALUES (5,NULL); +INSERT INTO t1 VALUES (6,NULL); +INSERT INTO t1 VALUES (7,9); +INSERT INTO t1 VALUES (8,0); + +SELECT pk, c1 +FROM t1 +WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240 +ORDER BY c1 +LIMIT 1; + +EXPLAIN SELECT pk, c1 +FROM t1 +WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240 +ORDER BY c1 +LIMIT 1; + +DROP TABLE t1; + +--echo # --echo # Bug#59259 "Incorrect rows returned for a correlated subquery --echo # when ICP is on" --echo # |