summaryrefslogtreecommitdiff
path: root/mysql-test/main/index_merge_innodb.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-12 06:50:12 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-12 06:50:12 +0300
commit55c75b6bb3d2cd8c36575fb7d440232aa961f9fb (patch)
treeeda77c1315b3c43f11324012fdc499b831430302 /mysql-test/main/index_merge_innodb.test
parent36824d2befaa8edd88f4627fb591983d80964bb4 (diff)
parent8e3d85e112964c4f7c2d07710a3c8ee9d5041685 (diff)
downloadmariadb-git-55c75b6bb3d2cd8c36575fb7d440232aa961f9fb.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/main/index_merge_innodb.test')
-rw-r--r--mysql-test/main/index_merge_innodb.test52
1 files changed, 22 insertions, 30 deletions
diff --git a/mysql-test/main/index_merge_innodb.test b/mysql-test/main/index_merge_innodb.test
index 7f9d6ac6eb1..fac199b1513 100644
--- a/mysql-test/main/index_merge_innodb.test
+++ b/mysql-test/main/index_merge_innodb.test
@@ -14,7 +14,12 @@
--source include/not_staging.inc
--source include/have_innodb.inc
-let $engine_type= InnoDB;
+connect disable_purge,localhost,root,,;
+--echo # Disable the purge of InnoDB history, to make the test run faster.
+START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connection default;
+
+SET STORAGE_ENGINE = InnoDB;
# InnoDB does not support Merge tables (affects include/index_merge1.inc)
let $merge_table_support= 0;
@@ -38,7 +43,9 @@ set optimizer_switch='rowid_filter=off';
--echo #
--echo # BUG#56862/640419: Wrong result with sort_union index merge when one
--echo # of the merged index scans is the primary key scan
---echo #
+--echo #
+
+CREATE TABLE t0(a int, b int) ENGINE=MyISAM;
CREATE TABLE t1 (
pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -47,27 +54,19 @@ CREATE TABLE t1 (
INDEX idx(a))
ENGINE=INNODB;
-begin;
-INSERT INTO t1(a,b) VALUES
+INSERT INTO t0(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
-INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
-INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
-INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
-INSERT INTO t1(a,b) SELECT a,b FROM t1;
+INSERT INTO t0(a,b) SELECT a+20, b+2000 FROM t0;
+INSERT INTO t0(a,b) SELECT a+40, b+4000 FROM t0;
+INSERT INTO t0(a,b) SELECT a+80, b+8000 FROM t0;
+begin;
+INSERT INTO t1(a,b) SELECT t0.a,t0.b FROM t0, seq_1_to_1024;
INSERT INTO t1 VALUES (1000000, 0, 0);
commit;
+DROP TABLE t0;
SET SESSION sort_buffer_size = 1024*36;
set @tmp_optimizer_switch=@@optimizer_switch;
@@ -132,9 +131,6 @@ DROP TABLE t1;
--echo # BUG#1006164: Multi-table DELETE that uses innodb + index_merge/intersect may fail to delete rows
--echo #
-create table t0(a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
create table t1 (
pk int auto_increment,
zone_id int,
@@ -144,7 +140,7 @@ create table t1 (
key (modified)
) engine=innodb;
-insert into t1 (zone_id, modified) select 0,0 from t0 A, t0 B, t0 C, t0 D;
+insert into t1 (zone_id, modified) select 0,0 from seq_1_to_10000;
update t1 set zone_id=487, modified=9 where pk=7259;
update t1 set zone_id=487, modified=9 where pk=7260;
update t1 set zone_id=830, modified=9 where pk=8434;
@@ -158,7 +154,7 @@ DELETE t1 FROM t1 WHERE t1.zone_id=830 AND modified=9;
commit;
select * from t1 where t1.zone_id=830 AND modified=9;
-drop table t0, t1;
+drop table t1;
--echo #
--echo # MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
@@ -198,14 +194,10 @@ KEY key1 (key1),
KEY key2 (key2)
) ENGINE=InnoDB AUTO_INCREMENT=12860259 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-create table t2(a int);
-insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t3(a int);
-insert into t3 select A.a + B.a* 10 + C.a * 100 + D.a*1000 from t2 A, t2 B, t2 C, t2 D;
-
insert into t1 (key1, key2, col1,col2,col3,col4)
-select a,a, a,a,a,a from t3;
+select seq,seq,seq,seq,seq,seq from seq_1_to_10000;
SELECT sum(col1) FROM t1 FORCE INDEX (key1,key2) WHERE (key1 between 10 and 8191+10) or (key2= 5);
-drop table t1,t2,t3;
+drop table t1;
set optimizer_switch=@tmp_optimizer_switch;
+
+disconnect disable_purge;