summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ctype_cp1250_ch.test3
-rw-r--r--mysql-test/t/func_like.test4
-rw-r--r--mysql-test/t/group_min_max.test20
-rw-r--r--mysql-test/t/index_merge_ror.test1
-rw-r--r--mysql-test/t/index_merge_ror_cpk.test2
-rw-r--r--mysql-test/t/join.test19
-rw-r--r--mysql-test/t/partition_pruning.test16
7 files changed, 51 insertions, 14 deletions
diff --git a/mysql-test/t/ctype_cp1250_ch.test b/mysql-test/t/ctype_cp1250_ch.test
index 2d1e5f0bf9d..8391582cfde 100644
--- a/mysql-test/t/ctype_cp1250_ch.test
+++ b/mysql-test/t/ctype_cp1250_ch.test
@@ -1,4 +1,7 @@
-- source include/have_cp1250_ch.inc
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
SHOW COLLATION LIKE 'cp1250_czech_cs';
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index 4e1183afeff..741ea5533da 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -8,8 +8,8 @@ drop table if exists t1;
create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
-explain select * from t1 where a like 'abc%';
-explain select * from t1 where a like concat('abc','%');
+explain extended select * from t1 where a like 'abc%';
+explain extended select * from t1 where a like concat('abc','%');
select * from t1 where a like "abc%";
select * from t1 where a like concat("abc","%");
select * from t1 where a like "ABC%";
diff --git a/mysql-test/t/group_min_max.test b/mysql-test/t/group_min_max.test
index 874f3cd1a80..8ba681d8e5f 100644
--- a/mysql-test/t/group_min_max.test
+++ b/mysql-test/t/group_min_max.test
@@ -489,7 +489,7 @@ select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1
-- plans
explain select distinct a1,a2,b from t1;
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
-explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
explain select distinct b from t1 where (a2 >= 'b') and (b = 'a');
@@ -497,7 +497,7 @@ explain select distinct b from t1 where (a2 >= 'b') and (b = 'a');
explain select distinct a1,a2,b from t2;
--replace_column 9 #
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
-explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
--replace_column 9 #
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
@@ -568,9 +568,9 @@ select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
-explain select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
+explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
-explain select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+explain extended select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
@@ -607,19 +607,19 @@ explain select a1,a2,b,d from t1 group by a1,a2,b;
-- predicate that references an attribute that is after the MIN/MAX argument
-- in the index
-explain select a1,a2,min(b),max(b) from t1
+explain extended select a1,a2,min(b),max(b) from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2;
-- predicate that references a non-indexed attribute
-explain select a1,a2,b,min(c),max(c) from t1
+explain extended select a1,a2,b,min(c),max(c) from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b;
-explain select a1,a2,b,c from t1
+explain extended select a1,a2,b,c from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c;
-- non-equality predicate for a non-group select attribute
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
-explain select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
+explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
-- non-group field with an equality predicate that references a keypart after the
-- MIN/MAX argument
@@ -638,8 +638,8 @@ explain select a1, a2, b, c, min(d), max(d) from t1 group by a1,a2,b,c;
-- other aggregate functions than MIN/MAX
explain select a1,a2,count(a2) from t1 group by a1,a2,b;
-explain select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
-explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
+explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
+explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
#
diff --git a/mysql-test/t/index_merge_ror.test b/mysql-test/t/index_merge_ror.test
index 48fe5526f11..474d8e3dbcd 100644
--- a/mysql-test/t/index_merge_ror.test
+++ b/mysql-test/t/index_merge_ror.test
@@ -97,7 +97,6 @@ select count(*) from t1;
# One row results tests for cases where a single row matches all conditions
explain select key1,key2 from t1 where key1=100 and key2=100;
select key1,key2 from t1 where key1=100 and key2=100;
-
explain select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
select key1,key2,key3,key4,filler1 from t1 where key1=100 and key2=100 or key3=100 and key4=100;
diff --git a/mysql-test/t/index_merge_ror_cpk.test b/mysql-test/t/index_merge_ror_cpk.test
index 94abf395d0a..d58d0b46dd8 100644
--- a/mysql-test/t/index_merge_ror_cpk.test
+++ b/mysql-test/t/index_merge_ror_cpk.test
@@ -63,7 +63,7 @@ select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1;
# Verify that CPK is always used for index intersection scans
# (this is because it is used as a filter, not for retrieval)
explain select * from t1 where badkey=1 and key1=10;
---replace_result 38 ROWS 37 ROWS
+--replace_column 9 ROWS
explain select * from t1 where pk1 < 7500 and key1 = 10;
# Verify that keys with 'tails' of PK members are ok.
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index e156ccd82a8..98bfb33b1e6 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -590,3 +590,22 @@ select * from ((t3 natural join (t1 natural join t2)) natural join t4)
drop table t1, t2, t3, t4, t5;
# End of tests for WL#2486 - natural/using join
+
+#
+# BUG#14940: Make E(#rows) from "range" access be re-used by range optimizer
+#
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t2 (a int, b int, filler char(100), key(a), key(b));
+create table t3 (a int, b int, filler char(100), key(a), key(b));
+
+insert into t2
+ select @a:= A.a + 10*(B.a + 10*C.a), @a, 'filler' from t1 A, t1 B, t1 C;
+insert into t3 select * from t2 where a < 800;
+
+# The order of tables must be t2,t3:
+explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b;
+
+drop table t1, t2, t3;
+
diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test
index 976466e1578..53db645adcb 100644
--- a/mysql-test/t/partition_pruning.test
+++ b/mysql-test/t/partition_pruning.test
@@ -407,13 +407,29 @@ explain partitions select * from t2 where a = 833;
explain partitions select * from t2 where (a = 100 OR a = 900);
explain partitions select * from t2 where (a > 100 AND a < 600);
explain partitions select * from t2 where b = 4;
+
+explain extended select * from t2 where b = 6;
explain partitions select * from t2 where b = 6;
+
+explain extended select * from t2 where b in (1,3,5);
explain partitions select * from t2 where b in (1,3,5);
+
+explain extended select * from t2 where b in (2,4,6);
explain partitions select * from t2 where b in (2,4,6);
+
+explain extended select * from t2 where b in (7,8,9);
explain partitions select * from t2 where b in (7,8,9);
+
+explain extended select * from t2 where b > 5;
explain partitions select * from t2 where b > 5;
+
+explain extended select * from t2 where b > 5 and b < 8;
explain partitions select * from t2 where b > 5 and b < 8;
+
+explain extended select * from t2 where b > 5 and b < 7;
explain partitions select * from t2 where b > 5 and b < 7;
+
+explain extended select * from t2 where b > 0 and b < 5;
explain partitions select * from t2 where b > 0 and b < 5;
flush status;