summaryrefslogtreecommitdiff
path: root/mysql-test/r/innodb_icp.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-05-25 16:01:56 -0700
committerIgor Babaev <igor@askmonty.org>2011-05-25 16:01:56 -0700
commitdeb3b9a17498d101468fc12a633245fc74730133 (patch)
tree8596b662f6af5d5367c95dff770ed2daf7516b35 /mysql-test/r/innodb_icp.result
parent7fc2d46a88aeb03da39439538e90fafc8cc76ad7 (diff)
downloadmariadb-git-deb3b9a17498d101468fc12a633245fc74730133.tar.gz
Downported InnoDB support of Index Condition Pushdown from MySQL-5.6 code line.
Diffstat (limited to 'mysql-test/r/innodb_icp.result')
-rw-r--r--mysql-test/r/innodb_icp.result59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index e4d81a9a3d5..c3643e62caa 100644
--- a/mysql-test/r/innodb_icp.result
+++ b/mysql-test/r/innodb_icp.result
@@ -200,4 +200,63 @@ COUNT(*)
12
DROP PROCEDURE insert_data;
DROP TABLE t1, t2, t3;
+#
+# Bug#57372 "Multi-table updates and deletes fail when running with ICP
+# against InnoDB"
+#
+CREATE TABLE t1 (
+a INT KEY,
+b INT
+);
+CREATE TABLE t2 (
+a INT KEY,
+b INT
+);
+INSERT INTO t1 VALUES (1, 101), (2, 102), (3, 103), (4, 104), (5, 105);
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+UPDATE t1, t2
+SET t1.a = t1.a + 100, t2.b = t1.a + 10
+WHERE t1.a BETWEEN 2 AND 4 AND t2.a = t1.b - 100;
+SELECT * FROM t1;
+a b
+1 101
+102 102
+103 103
+104 104
+5 105
+SELECT * FROM t2;
+a b
+1 1
+2 12
+3 13
+4 14
+5 5
+DROP TABLE t1, t2;
+#
+# Bug#59259 "Incorrect rows returned for a correlated subquery
+# when ICP is on"
+#
+CREATE TABLE t1 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (11,0);
+INSERT INTO t1 VALUES (12,5);
+INSERT INTO t1 VALUES (15,0);
+CREATE TABLE t2 (pk INTEGER PRIMARY KEY, i INTEGER NOT NULL) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (11,1);
+INSERT INTO t2 VALUES (12,2);
+INSERT INTO t2 VALUES (15,4);
+set @save_optimizer_switch= @@optimizer_switch;
+set optimizer_switch='semijoin=off';
+EXPLAIN
+SELECT * FROM t1
+WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index
+2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index condition
+SELECT * FROM t1
+WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10);
+pk i
+12 5
+set optimizer_switch=@save_optimizer_switch;
+DROP TABLE t1, t2;
set storage_engine= @save_storage_engine;