diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/partition_bug18198.test | 33 | ||||
-rw-r--r-- | mysql-test/t/partition_charset.test | 7 | ||||
-rw-r--r-- | mysql-test/t/partition_error.test | 3 | ||||
-rw-r--r-- | mysql-test/t/partition_pruning.test | 22 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 128 |
5 files changed, 80 insertions, 113 deletions
diff --git a/mysql-test/t/partition_bug18198.test b/mysql-test/t/partition_bug18198.test index caf9bd560c0..7f071c6ec9e 100644 --- a/mysql-test/t/partition_bug18198.test +++ b/mysql-test/t/partition_bug18198.test @@ -3,45 +3,12 @@ drop table if exists t1; --enable_warnings -create table t1 (a char(5) character set koi8r) -partition by list (ascii(a) mod 3) -subpartition by hash(ascii(a)) -subpartitions 3 -(partition p1 values in (1), - partition p2 values in (2), - partition p0 values in (0)); -insert into t1 values ('a'); -explain partitions select * from t1 where a = 'a'; -select * from t1 where a = 'a'; -drop table t1; - -create table t1 (a char(5) character set cp1251) -partition by list (ascii(a)) (partition pn values in (null)); -drop table t1; - create table t1 (col1 datetime) partition by range(datediff(col1,col1)) (partition p0 values less than (10), partition p1 values less than (30)); drop table t1; -- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED -create table t1 (a char(5) character set big5) -partition by list (ascii(a)) (partition pn values in (null)); - -create table t1 (a char(1)) -partition by list(ascii(a)) -(partition p1 values in (ascii('i'))); -#insert into t1 values ('i'); -drop table t1; - -create table t1 (s1 char(5) character set latin5) -partition by list (ascii(s1)) -(partition p1 values in (1)); -set names utf8; -#insert into tn values ('żż'); -drop table t1; - --- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (col1 int) partition by range(greatest(col1,10)) (partition p0 values less than (2), partition p1 values less than (6)); diff --git a/mysql-test/t/partition_charset.test b/mysql-test/t/partition_charset.test index 5e8f128e87a..6842e5268fa 100644 --- a/mysql-test/t/partition_charset.test +++ b/mysql-test/t/partition_charset.test @@ -20,9 +20,10 @@ set names latin1; select * from t1; drop table t1; +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (a varchar(1), primary key (a)) partition by list (ascii(a)) (partition p1 values in (65)); -insert into t1 values ('A'); -replace into t1 values ('A'); -drop table t1; +#insert into t1 values ('A'); +#replace into t1 values ('A'); +#drop table t1; diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index fa5055b2981..5fc2097cc52 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -769,10 +769,11 @@ partition by range (a) # # Bug 18198 Partitions: Verify that erroneus partition functions doesn't work # +-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); -drop table t1; +#drop table t1; -- error 1064 create table t1 (a int) diff --git a/mysql-test/t/partition_pruning.test b/mysql-test/t/partition_pruning.test index cef57bd9356..12951c9232a 100644 --- a/mysql-test/t/partition_pruning.test +++ b/mysql-test/t/partition_pruning.test @@ -538,17 +538,17 @@ select * from t1 where f_int1 between 5 and 15 order by f_int1; drop table t1; # part2: bug in pruning code -create table t1 (a char(10) binary) -partition by list(ascii(a)) - (partition p1 values in (ascii('a')), - partition p2 values in (ascii('b')), - partition p3 values in (ascii('c')), - partition p4 values in (ascii('d')), - partition p5 values in (ascii('e'))); -insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); -select * from t1 where a>='a' and a <= 'dddd'; -explain partitions select * from t1 where a>='a' and a <= 'dddd'; -drop table t1; +#create table t1 (a char(10) binary) +#partition by list(ascii(a)) +# (partition p1 values in (ascii('a')), +# partition p2 values in (ascii('b')), +# partition p3 values in (ascii('c')), +# partition p4 values in (ascii('d')), +# partition p5 values in (ascii('e'))); +#insert into t1 values ('a'),('bb'),('ccc'),('dddd'),('eeEee'); +#select * from t1 where a>='a' and a <= 'dddd'; +#explain partitions select * from t1 where a>='a' and a <= 'dddd'; +#drop table t1; # BUG#18659: Assertion failure when subpartitioning is used and partition is # "IS NULL" diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 219637d6f81..50d850913bc 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -12,45 +12,45 @@ drop table if exists t1; # # BUG 18198: Various tests for partition functions # -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) -partition by range (b* ascii(a) * b) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 2),('a',3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(b) * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin) -partition by range (ascii(a) * ascii(b)) -(partition p0 values less than (2), partition p1 values less than (40000)); -insert into t1 values ('a ', 'b '),('a','b'); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (ascii(a) * c) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; - -create table t1 (a varchar(10) charset latin1 collate latin1_bin, - b varchar(10) charset latin1 collate latin1_bin, c int) -partition by range (c * ascii(a)) -(partition p0 values less than (2), partition p1 values less than (4000)); -insert into t1 values ('a ', 'b ', 2),('a','b', 3); -drop table t1; +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, b int) +#partition by range (b* ascii(a) * b) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 2),('a',3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(b) * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin) +#partition by range (ascii(a) * ascii(b)) +#(partition p0 values less than (2), partition p1 values less than (40000)); +#insert into t1 values ('a ', 'b '),('a','b'); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (ascii(a) * c) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; + +#create table t1 (a varchar(10) charset latin1 collate latin1_bin, +# b varchar(10) charset latin1 collate latin1_bin, c int) +#partition by range (c * ascii(a)) +#(partition p0 values less than (2), partition p1 values less than (4000)); +#insert into t1 values ('a ', 'b ', 2),('a','b', 3); +#drop table t1; # # More checks for partition pruning @@ -733,29 +733,27 @@ DROP TABLE t1; # # Bug 18198: Try with a couple of cases using VARCHAR fields in # partition function. -create table t1 (a varchar(20)) -partition by range (ascii(a)) -(partition p0 values less than (100), - partition p1 values less than maxvalue); - -insert into t1 values ("12345678901234567890"); -insert into t1 values ("A2345678901234567890"); -insert into t1 values ("B2345678901234567890"); -insert into t1 values ("1234567890123456789"); -insert into t1 values ("1234567890123456"); -select * from t1; -explain partitions select * from t1 where a = "12345678901234567890"; -explain partitions select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -explain partitions select * from t1 where a = "01234567890123456"; -select * from t1 where a = "01234567890123456"; -select * from t1 where a = "12345678901234567890" OR - a = "A2345678901234567890" OR - a = "B2345678901234567890" OR - a = "C2345678901234567890"; -select * from t1 where a = "12345678901234567890"; - - -drop table t1; +#create table t1 (a varchar(20)) +#partition by range (ascii(a)) +#(partition p0 values less than (100), +# partition p1 values less than maxvalue); + +#insert into t1 values ("12345678901234567890"); +#insert into t1 values ("A2345678901234567890"); +#insert into t1 values ("B2345678901234567890"); +#insert into t1 values ("1234567890123456789"); +#insert into t1 values ("1234567890123456"); +#select * from t1; +#explain partitions select * from t1 where a = "12345678901234567890"; +#explain partitions select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#explain partitions select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "01234567890123456"; +#select * from t1 where a = "12345678901234567890" OR +# a = "A2345678901234567890" OR +# a = "B2345678901234567890" OR +# a = "C2345678901234567890"; +#select * from t1 where a = "12345678901234567890"; +#drop table t1; |