From e5627c9802460c745814961e721191ff4b6c91b3 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Sun, 30 Oct 2011 04:18:09 -0700 Subject: Backported the test case for bug 58838 from mysql-5.6 code line. The bug was fixed by the patches for LP bugs 668644,702322 that were applied earlier to the mariadb-5.3 code. --- mysql-test/r/innodb_icp.result | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'mysql-test/r/innodb_icp.result') diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result index 7f99dd4809b..58f23d5f341 100644 --- a/mysql-test/r/innodb_icp.result +++ b/mysql-test/r/innodb_icp.result @@ -514,6 +514,30 @@ WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR c2 DROP TABLE t1, t2; # +# Bug#58838: "Wrong results with HAVING + LIMIT without GROUP BY when +# ICP is enabled". +# (Fixed by the patches for LP bugs #668644, #702322) +# +CREATE TABLE t1 ( +pk INT NOT NULL, +c1 INT, +PRIMARY KEY (pk), +KEY col_int_key (c1) +); +INSERT INTO t1 VALUES (1,37),(2,8),(3,-25),(4,NULL),(5,55); +SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3 ORDER BY pk LIMIT 0; +pk +SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3 ORDER BY pk LIMIT 1; +pk +3 +SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3 ORDER BY pk LIMIT 2; +pk +3 +SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3 ORDER BY pk LIMIT 5; +pk +3 +DROP TABLE t1; +# # BUG#778434 Wrong result with in_to_exists=on in maria-5.3-mwl89 # CREATE TABLE t1 ( f11 int) ; -- cgit v1.2.1