summaryrefslogtreecommitdiff
path: root/mysql-test/main/index_merge_myisam.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-15 09:56:03 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-15 09:56:03 +0300
commit84db10f27bdb4c8d9edf7f554afdcd2a24e3285a (patch)
tree5f9d5b22cdfee6f147274d85b279d98f8a1bb46b /mysql-test/main/index_merge_myisam.result
parent9aacda409db8606b985a93f675487943846cbc86 (diff)
parentccaec18b3934ee384296b4597bdf462fac66c5a4 (diff)
downloadmariadb-git-84db10f27bdb4c8d9edf7f554afdcd2a24e3285a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/index_merge_myisam.result')
-rw-r--r--mysql-test/main/index_merge_myisam.result53
1 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/main/index_merge_myisam.result b/mysql-test/main/index_merge_myisam.result
index c8520f18c43..0663b2d4e90 100644
--- a/mysql-test/main/index_merge_myisam.result
+++ b/mysql-test/main/index_merge_myisam.result
@@ -1689,6 +1689,58 @@ id select_type table type possible_keys key key_len ref rows Extra
DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;
#
+# MDEV-21932: ROR union with index_merge_sort_union=off
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+insert into t0 select a+10 from t0;
+insert into t0 select a+20 from t0;
+insert into t0 select a+40 from t0;
+insert into t0 select a+80 from t0;
+insert into t0 select a+160 from t0;
+delete from t0 where a > 300;
+create table t1 (
+f1 int, f2 int, f3 int, f4 int,
+primary key (f1), key (f3), key(f4)
+) engine=myisam;
+insert into t1 select a+100, a+100, a+100, a+100 from t0;
+insert into t1 VALUES (9,0,2,6), (9930,0,0,NULL);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+set optimizer_switch='index_merge_sort_union=off';
+set optimizer_switch='index_merge_union=on';
+explain select * from t1
+where (( f3 = 1 or f1 = 7 ) and f1 < 10) or
+(f3 between 2 and 2 and ( f3 = 1 or f4 < 7 ));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge PRIMARY,f3,f4 f3,PRIMARY,f3 5,4,5 NULL 3 Using union(f3,PRIMARY,f3); Using where
+select * from t1
+where (( f3 = 1 or f1 = 7 ) and f1 < 10) or
+(f3 between 2 and 2 and ( f3 = 1 or f4 < 7 ));
+f1 f2 f3 f4
+9 0 2 6
+insert into t1 values (52,0,1,0),(53,0,1,0);
+insert into t1 values (50,0,1,0),(51,0,1,0);
+insert into t1 values (48,0,1,0),(49,0,1,0);
+insert into t1 values (46,0,1,0),(47,0,1,0);
+insert into t1 values (44,0,1,0),(45,0,1,0);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+explain select * from t1
+where (( f3 = 1 or f1 = 7 ) and f1 < 10) or
+(f3 between 2 and 2 and ( f3 = 1 or f4 < 7 ));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge PRIMARY,f3,f4 f3,PRIMARY,f3 5,4,5 NULL 13 Using union(f3,PRIMARY,f3); Using where
+select * from t1
+where (( f3 = 1 or f1 = 7 ) and f1 < 10) or
+(f3 between 2 and 2 and ( f3 = 1 or f4 < 7 ));
+f1 f2 f3 f4
+9 0 2 6
+drop table t0,t1;
+set optimizer_switch= @optimizer_switch_save;
+#
# MDEV-16695: Estimate for rows of derived tables is very high when we are using index_merge union
#
create table t0
@@ -1723,3 +1775,4 @@ key1 key2 key3 key8
3 3 3 1021
set @@optimizer_switch= @optimizer_switch_save;
drop table t0;
+# End of 10.1 tests