summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-07-04 14:34:45 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-07-04 14:34:45 +0400
commit46525c35b084a8af4dc99c8da78cf9e40e69dee1 (patch)
tree5144c1812b39ea2ea2f66efb382be249f64b90c0 /mysql-test
parentf8f65accf99821386ad2cffdf0c3f473e8f33064 (diff)
downloadmariadb-git-46525c35b084a8af4dc99c8da78cf9e40e69dee1.tar.gz
MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
- Let QUICK_RANGE_SELECT::init_ror_merged_scan() call quick->reset() only after we've set the column read bitmaps.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/index_merge_innodb.result15
-rw-r--r--mysql-test/t/index_merge_innodb.test15
2 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index b8eda092291..92bcb2e88f0 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -777,4 +777,19 @@ commit;
select * from t1 where t1.zone_id=830 AND modified=9;
pk zone_id modified
drop table t0, t1;
+#
+# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
+#
+CREATE TABLE t1 (
+a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
+SELECT ta.* FROM t1 AS ta, t1 AS tb
+WHERE ( tb.b != ta.b OR tb.a = ta.a )
+AND ( tb.b = ta.c OR tb.b = ta.b );
+a b c
+8 v v
+8 m m
+9 d d
+DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;
diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test
index 0fd3c54c787..6a1cb53dc40 100644
--- a/mysql-test/t/index_merge_innodb.test
+++ b/mysql-test/t/index_merge_innodb.test
@@ -156,6 +156,21 @@ select * from t1 where t1.zone_id=830 AND modified=9;
drop table t0, t1;
+--echo #
+--echo # MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
+--echo #
+CREATE TABLE t1 (
+ a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
+
+
+SELECT ta.* FROM t1 AS ta, t1 AS tb
+WHERE ( tb.b != ta.b OR tb.a = ta.a )
+ AND ( tb.b = ta.c OR tb.b = ta.b );
+
+DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;