diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-01 10:24:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-04-01 10:24:36 +0300 |
commit | f813131c7b235a490399764ba75c6138e602c23e (patch) | |
tree | 9360a0ff33952bf6f88771c4669eb18a9b438978 /mysql-test/r | |
parent | f9639c2d1a5e24f1a1533b6277fe7eca3aa3c3c0 (diff) | |
parent | 24cb76b8dd86bf54f264352be41506995b6c89c4 (diff) | |
download | mariadb-git-bb-10.1-merge.tar.gz |
Merge 5.5 into 10.1bb-10.1-merge
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/index_merge_myisam.result | 53 | ||||
-rw-r--r-- | mysql-test/r/range_innodb.result | 28 | ||||
-rw-r--r-- | mysql-test/r/range_vs_index_merge.result | 2 |
3 files changed, 82 insertions, 1 deletions
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index b87a7dfef4b..8f3d536983f 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -1685,6 +1685,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 @@ -1719,3 +1771,4 @@ key1 key2 key3 key8 3 3 3 1021 set @@optimizer_switch= @optimizer_switch_save; drop table t0; +# End of 10.1 tests diff --git a/mysql-test/r/range_innodb.result b/mysql-test/r/range_innodb.result index 6572b248911..faeec530acb 100644 --- a/mysql-test/r/range_innodb.result +++ b/mysql-test/r/range_innodb.result @@ -37,6 +37,33 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 10 1 SIMPLE t2 range a,b b 5 NULL 201 Using where; Using join buffer (flat, BNL join) drop table t0,t1,t2; +# +# MDEV-10466: constructing an invalid SEL_ARG +# +create table t1 ( +pk int, a int, b int, +primary key (pk), index idx1(b), index idx2(b) +) engine=innodb; +Warnings: +Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release. +insert into t1 values (1,6,0),(2,1,0),(3,5,2),(4,8,0); +create table t2 (c int) engine=innodb; +insert into t2 values (1),(2); +create table t3 (d int) engine=innodb; +insert into t3 values (3),(-1),(4); +set @save_optimizer_switch=@@optimizer_switch; +set optimizer_switch='extended_keys=on'; +explain +select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 +1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL 4 Using where; Using join buffer (incremental, BNL join) +select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; +pk a b +1 6 0 +set optimizer_switch=@save_optimizer_switch; +drop table t1,t2,t3; CREATE TABLE t1 ( pk INT PRIMARY KEY, f1 INT, f2 CHAR(1), f3 CHAR(1), KEY(f1), KEY(f2) @@ -79,3 +106,4 @@ ERROR HY000: Table definition has changed, please retry transaction DROP TABLE t0,t1; set @@global.debug_dbug="-d"; set @@optimizer_switch= @optimizer_switch_save; +# End of 10.1 tests diff --git a/mysql-test/r/range_vs_index_merge.result b/mysql-test/r/range_vs_index_merge.result index 4f3c36b7660..faab314896c 100644 --- a/mysql-test/r/range_vs_index_merge.result +++ b/mysql-test/r/range_vs_index_merge.result @@ -1659,7 +1659,7 @@ SELECT * FROM t1 FORCE KEY (PRIMARY,f3,f4) WHERE ( f3 = 1 OR f1 = 7 ) AND f1 < 10 OR f3 BETWEEN 2 AND 2 AND ( f3 = 1 OR f4 != 1 ); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL PRIMARY,f3,f4 NULL NULL NULL 2 Using where +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 FORCE KEY (PRIMARY,f3,f4) WHERE ( f3 = 1 OR f1 = 7 ) AND f1 < 10 OR f3 BETWEEN 2 AND 2 AND ( f3 = 1 OR f4 != 1 ); |