summaryrefslogtreecommitdiff
path: root/mysql-test/t/innodb_mrr_cpk.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/innodb_mrr_cpk.test')
-rw-r--r--mysql-test/t/innodb_mrr_cpk.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/innodb_mrr_cpk.test b/mysql-test/t/innodb_mrr_cpk.test
index a157ddd792f..a7b2d9c0ddd 100644
--- a/mysql-test/t/innodb_mrr_cpk.test
+++ b/mysql-test/t/innodb_mrr_cpk.test
@@ -139,3 +139,29 @@ set storage_engine=@save_storage_engine;
set optimizer_switch=@innodb_mrr_cpk_tmp;
drop table t0;
+--echo #
+--echo # MDEV-3817: Wrong result with index_merge+index_merge_intersection, InnoDB table, join, AND and OR conditions
+--echo #
+
+set @tmp_mdev3817=@@optimizer_switch;
+SET optimizer_switch='index_merge=on,index_merge_intersection=on';
+
+CREATE TABLE t1 (
+ a INT PRIMARY KEY,
+ b INT,
+ c VARCHAR(1024) CHARACTER SET utf8,
+ d INT,
+ KEY (b)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES
+(1, 9, 'one', 11), (2, 6, 'two', 12), (3, 2, 'three', 13), (4, 5, 'four', 14);
+
+CREATE TABLE t2 (e INT, g INT) ENGINE=InnoDB;
+INSERT INTO t2 VALUES (1,9), (2,6) ;
+
+SELECT * FROM t1, t2 WHERE g = b AND ( a < 7 OR a > e );
+
+DROP TABLE t1, t2;
+set optimizer_switch=@tmp_mdev3817;
+