summaryrefslogtreecommitdiff
path: root/mysql-test/t/myisam_icp.test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2011-11-07 23:30:03 +0400
committerSergey Petrunya <psergey@askmonty.org>2011-11-07 23:30:03 +0400
commit7c7611d728d393dcc39bfd73ab5b3d56491ff9e7 (patch)
tree0161559f38c45f22d6043b18e7c7c2668819b7e9 /mysql-test/t/myisam_icp.test
parente0500dbc3ac99fc366982f721418fb67c1961cde (diff)
downloadmariadb-git-7c7611d728d393dcc39bfd73ab5b3d56491ff9e7.tar.gz
BUG#887026: Wrong result with ICP, outer join, subquery in maria-5.3-icp
- Do not push index condition if we're using a triggered ref access.
Diffstat (limited to 'mysql-test/t/myisam_icp.test')
-rw-r--r--mysql-test/t/myisam_icp.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/myisam_icp.test b/mysql-test/t/myisam_icp.test
index 7e7affb1b8f..bbff6c30e56 100644
--- a/mysql-test/t/myisam_icp.test
+++ b/mysql-test/t/myisam_icp.test
@@ -227,4 +227,34 @@ SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
DROP TABLE t1;
+--echo #
+--echo # BUG#887026: Wrong result with ICP, outer join, subquery in maria-5.3-icp
+--echo #
+
+CREATE TABLE t1 (c varchar(1));
+INSERT INTO t1 VALUES ('c'), ('c');
+
+CREATE TABLE t2 (c varchar(1), b int);
+INSERT INTO t2 VALUES ('d', NULL),('d', NULL);
+
+CREATE TABLE t3 (c varchar(1));
+INSERT INTO t3 VALUES ('c');
+INSERT INTO t3 VALUES ('c');
+
+CREATE TABLE t4 ( b int, c varchar(1), KEY (b));
+INSERT INTO t4 VALUES (7,'c');
+INSERT INTO t4 VALUES (7,'c');
+
+--echo # Must be t1,t2,t3,t4, with t4 having Full-scan-on-NULL but not Using index condition
+explain
+SELECT * FROM t1 LEFT JOIN t2 ON t1.c=t2.b
+WHERE
+ t2.b NOT IN (SELECT t4.b FROM t3 STRAIGHT_JOIN t4 WHERE t4.b <= 2 AND t4.c = t3.c);
+
+SELECT * FROM t1 LEFT JOIN t2 ON t1.c=t2.b
+WHERE
+ t2.b NOT IN (SELECT t4.b FROM t3 STRAIGHT_JOIN t4 WHERE t4.b <= 2 AND t4.c = t3.c);
+
+DROP TABLE t1,t2,t3,t4;
+
set optimizer_switch=@myisam_icp_tmp;