diff options
author | Mikael Ronstrom <mikael@mysql.com> | 2009-10-16 16:16:06 +0200 |
---|---|---|
committer | Mikael Ronstrom <mikael@mysql.com> | 2009-10-16 16:16:06 +0200 |
commit | c90669c4d423ba46f09aadde5ff6662e8a63a1c0 (patch) | |
tree | df5230b4e7781d295ef1eb1cedbd289ee413a075 /mysql-test | |
parent | 576dd76aa81787f71e038efd9e00713b7a44b3c5 (diff) | |
download | mariadb-git-c90669c4d423ba46f09aadde5ff6662e8a63a1c0.tar.gz |
Fixed removal of column_list keyword for VALUES part, retained for PARTITION BY RANGE/LIST COLUMN_LIST, not entirely working yet
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/partition_innodb.result | 12 | ||||
-rw-r--r-- | mysql-test/r/partition_range.result | 10 | ||||
-rw-r--r-- | mysql-test/t/partition_column.test | 131 | ||||
-rw-r--r-- | mysql-test/t/partition_innodb.test | 12 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 10 |
5 files changed, 86 insertions, 89 deletions
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index fb991ef5fcc..89cf8709b90 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -2,24 +2,24 @@ drop table if exists t1; create table t1 (a varchar(5)) engine=memory partition by range column_list(a) -( partition p0 values less than (column_list('m')), -partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), +partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; create table t1 (a varchar(5)) engine=myisam partition by range column_list(a) -( partition p0 values less than (column_list('m')), -partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), +partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; create table t1 (a varchar(5)) engine=innodb partition by range column_list(a) -( partition p0 values less than (column_list('m')), -partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), +partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result index fc15665d698..00ada13ed13 100644 --- a/mysql-test/r/partition_range.result +++ b/mysql-test/r/partition_range.result @@ -78,12 +78,12 @@ partition by range column_list(a,b) ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3 create table t1 (a int, b char(20)) partition by range(a) -(partition p0 values less than (column_list(1,"b"))); -ERROR HY000: Inconsistency in usage of column lists for partitioning +(partition p0 values less than (1,"b")); +ERROR HY000: Cannot have more than one value for this type of RANGE partitioning create table t1 (a int, b char(20)) partition by range(a) -(partition p0 values less than (column_list(1,"b"))); -ERROR HY000: Inconsistency in usage of column lists for partitioning +(partition p0 values less than (1,"b")); +ERROR HY000: Cannot have more than one value for this type of RANGE partitioning create table t1 (a int, b char(20)); create global index inx on t1 (a,b) partition by range (a) @@ -91,7 +91,7 @@ partition by range (a) drop table t1; create table t1 (a int, b char(20)) partition by range column_list(b) -(partition p0 values less than (column_list("b"))); +(partition p0 values less than ("b")); drop table t1; create table t1 (a int) partition by range (a) diff --git a/mysql-test/t/partition_column.test b/mysql-test/t/partition_column.test index 1c7e8d59895..edce77e2233 100644 --- a/mysql-test/t/partition_column.test +++ b/mysql-test/t/partition_column.test @@ -17,7 +17,7 @@ partition by key (a,a); --error ER_SAME_NAME_PARTITION_FIELD create table t1 (a int, b int) partition by list column_list(a,a) -( partition p values in (column_list(1,1))); +( partition p values in ((1,1))); # # BUG#47838, List partitioning have problems with <= and >= @@ -35,10 +35,8 @@ drop table t1; create table t1 (a int signed) partition by list column_list(a) -( partition p0 values in (column_list(1), column_list(3), column_list(5), - column_list(7), column_list(9), column_list(NULL)), - partition p1 values in (column_list(2), column_list(4), column_list(6), - column_list(8), column_list(0))); +( partition p0 values in (1, 3, 5, 7, 9, NULL), + partition p1 values in (2, 4, 6, 8, 0)); insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8); select * from t1 where a <= NULL; select * from t1 where a is null; @@ -48,10 +46,9 @@ drop table t1; create table t1 (a int, b int) partition by list column_list(a,b) -( partition p0 values in (column_list(1, NULL), column_list(2, NULL), - column_list(NULL, NULL)), - partition p1 values in (column_list(1,1), column_list(2,2)), - partition p2 values in (column_list(3, NULL), column_list(NULL, 1))); +( partition p0 values in ((1, NULL), (2, NULL), (NULL, NULL)), + partition p1 values in ((1,1), (2,2)), + partition p2 values in ((3, NULL), (NULL, 1))); # # BUG#47754 Crash when selecting using NOT BETWEEN for column list partitioning # @@ -88,10 +85,16 @@ insert into t1 values (NULL); insert into t1 values (5); drop table t1; +--error ER_PARSE_ERROR +create table t1 (a int) +partition by list column_list(a) +( partition p0 values in (2, 1), + partition p1 values in ((4), (NULL), (3))); + create table t1 (a int) partition by list column_list(a) -( partition p0 values in (column_list(2), column_list(1)), - partition p1 values in (column_list(4), column_list(NULL), column_list(3))); +( partition p0 values in (2, 1), + partition p1 values in (4, NULL, 3)); insert into t1 values (1); insert into t1 values (2); insert into t1 values (3); @@ -106,20 +109,20 @@ create table t1 (a int, b char(10), c varchar(25), d datetime) partition by range column_list(a,b,c,d) subpartition by hash (to_seconds(d)) subpartitions 4 -( partition p0 values less than (column_list(1, NULL, MAXVALUE, NULL)), - partition p1 values less than (column_list(1, 'a', MAXVALUE, TO_DAYS('1999-01-01'))), - partition p2 values less than (column_list(1, 'a', MAXVALUE, MAXVALUE)), - partition p3 values less than (column_list(1, MAXVALUE, MAXVALUE, MAXVALUE))); +( partition p0 values less than (1, NULL, MAXVALUE, NULL), + partition p1 values less than (1, 'a', MAXVALUE, TO_DAYS('1999-01-01')), + partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE), + partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE)); drop table t1; create table t1 (a int, b char(10), c varchar(5), d int) partition by range column_list(a,b,c) subpartition by key (c,d) subpartitions 3 -( partition p0 values less than (column_list(1,'abc','abc')), - partition p1 values less than (column_list(2,'abc','abc')), - partition p2 values less than (column_list(3,'abc','abc')), - partition p3 values less than (column_list(4,'abc','abc'))); +( partition p0 values less than (1,'abc','abc'), + partition p1 values less than (2,'abc','abc'), + partition p2 values less than (3,'abc','abc'), + partition p3 values less than (4,'abc','abc')); insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3); insert into t1 values (1,'b','c',1),(2,'b','c',2),(3,'b','c',3); @@ -131,8 +134,8 @@ drop table t1; create table t1 (a int, b varchar(2), c int) partition by range column_list (a, b, c) -(partition p0 values less than (column_list(1, 'A', 1)), - partition p1 values less than (column_list(1, 'B', 1))); +(partition p0 values less than (1, 'A', 1), + partition p1 values less than (1, 'B', 1)); insert into t1 values (1, 'A', 1); explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1; select * from t1 where a = 1 AND b <= 'A' and c = 1; @@ -140,7 +143,7 @@ drop table t1; create table t1 (a char, b char, c char) partition by list column_list(a) -( partition p0 values in (column_list('a'))); +( partition p0 values in ('a')); insert into t1 (a) values ('a'); select * from t1 where a = 'a'; drop table t1; @@ -148,36 +151,36 @@ drop table t1; --error ER_WRONG_TYPE_COLUMN_VALUE_ERROR create table t1 (d timestamp) partition by range column_list(d) -( partition p0 values less than (column_list('2000-01-01')), - partition p1 values less than (column_list('2040-01-01'))); +( partition p0 values less than ('2000-01-01'), + partition p1 values less than ('2040-01-01')); create table t1 (a int, b int) partition by range column_list(a,b) -(partition p0 values less than (column_list(null, 10))); +(partition p0 values less than (null, 10)); drop table t1; create table t1 (d date) partition by range column_list(d) -( partition p0 values less than (column_list('2000-01-01')), - partition p1 values less than (column_list('2009-01-01'))); +( partition p0 values less than ('2000-01-01'), + partition p1 values less than ('2009-01-01')); drop table t1; create table t1 (d date) partition by range column_list(d) -( partition p0 values less than (column_list('1999-01-01')), - partition p1 values less than (column_list('2000-01-01'))); +( partition p0 values less than ('1999-01-01'), + partition p1 values less than ('2000-01-01')); drop table t1; create table t1 (d date) partition by range column_list(d) -( partition p0 values less than (column_list('2000-01-01')), - partition p1 values less than (column_list('3000-01-01'))); +( partition p0 values less than ('2000-01-01'), + partition p1 values less than ('3000-01-01')); drop table t1; create table t1 (a int, b int) partition by range column_list(a,b) -(partition p2 values less than (column_list(99,99)), - partition p1 values less than (column_list(99,999))); +(partition p2 values less than (99,99), + partition p1 values less than (99,999)); insert into t1 values (99,998); select * from t1 where b = 998; @@ -191,22 +194,22 @@ drop table t1; --error ER_PARSE_ERROR create table t1 (a int, b int) partition by list column_list(a,b) -(partition p0 values in (column_list(maxvalue,maxvalue))); +(partition p0 values in ((maxvalue,maxvalue))); create table t1 (a int, b int) partition by range column_list(a,b) -(partition p0 values less than (column_list(maxvalue,maxvalue))); +(partition p0 values less than (maxvalue,maxvalue)); drop table t1; create table t1 (a int) partition by list column_list(a) -(partition p0 values in (column_list(0))); +(partition p0 values in (0)); select partition_method from information_schema.partitions where table_name='t1'; drop table t1; create table t1 (a char(6)) partition by range column_list(a) -(partition p0 values less than (column_list('H23456')), - partition p1 values less than (column_list('M23456'))); +(partition p0 values less than ('H23456'), + partition p1 values less than ('M23456')); insert into t1 values ('F23456'); select * from t1; drop table t1; @@ -214,14 +217,14 @@ drop table t1; -- error 1054 create table t1 (a char(6)) partition by range column_list(a) -(partition p0 values less than (column_list(H23456)), - partition p1 values less than (column_list(M23456))); +(partition p0 values less than (H23456), + partition p1 values less than (M23456)); -- error ER_RANGE_NOT_INCREASING_ERROR create table t1 (a char(6)) partition by range column_list(a) -(partition p0 values less than (column_list(23456)), - partition p1 values less than (column_list(23456))); +(partition p0 values less than (23456), + partition p1 values less than (23456)); -- error 1064 create table t1 (a int, b int) @@ -231,14 +234,14 @@ partition by range column_list(a,b) -- error ER_PARTITION_COLUMN_LIST_ERROR create table t1 (a int, b int) partition by range column_list(a,b) -(partition p0 values less than (column_list(1,1,1)); +(partition p0 values less than (1,1,1); create table t1 (a int, b int) partition by range column_list(a,b) -(partition p0 values less than (column_list(1, NULL)), - partition p1 values less than (column_list(2, maxvalue)), - partition p2 values less than (column_list(3, 3)), - partition p3 values less than (column_list(10, NULL))); +(partition p0 values less than (1, NULL), + partition p1 values less than (2, maxvalue), + partition p2 values less than (3, 3), + partition p3 values less than (10, NULL)); -- error ER_NO_PARTITION_FOR_GIVEN_VALUE insert into t1 values (10,0); @@ -247,57 +250,51 @@ select * from t1; alter table t1 partition by range column_list(b,a) -(partition p0 values less than (column_list(1,2)), - partition p1 values less than (column_list(3,3)), - partition p2 values less than (column_list(9,5))); +(partition p0 values less than (1,2), + partition p1 values less than (3,3), + partition p2 values less than (9,5)); explain partitions select * from t1 where b < 2; select * from t1 where b < 2; explain partitions select * from t1 where b < 4; select * from t1 where b < 4; alter table t1 reorganize partition p1 into -(partition p11 values less than (column_list(2,2)), - partition p12 values less than (column_list(3,3))); +(partition p11 values less than (2,2), + partition p12 values less than (3,3)); -- error ER_REORG_OUTSIDE_RANGE alter table t1 reorganize partition p0 into -(partition p01 values less than (column_list(0,3)), - partition p02 values less than (column_list(1,1))); +(partition p01 values less than (0,3), + partition p02 values less than (1,1)); -- error ER_PARTITION_COLUMN_LIST_ERROR alter table t1 reorganize partition p2 into -(partition p2 values less than(column_list(9,6,1))); +(partition p2 values less than(9,6,1)); -- error ER_PARTITION_COLUMN_LIST_ERROR alter table t1 reorganize partition p2 into (partition p2 values less than (10)); alter table t1 reorganize partition p2 into -(partition p21 values less than (column_list(4,7)), - partition p22 values less than (column_list(9,5))); +(partition p21 values less than (4,7), + partition p22 values less than (9,5)); explain partitions select * from t1 where b < 4; select * from t1 where b < 4; drop table t1; -#create table t1 (a int, b int) -#partition by range column_list(a,b) -#(partition p0 values less than (column_list(99,99)), -# partition p1 values less than (column_list(99,maxvalue))); -#drop table t1; - create table t1 (a int, b int) partition by list column_list(a,b) subpartition by hash (b) subpartitions 2 -(partition p0 values in (column_list(0,0), column_list(1,1)), - partition p1 values in (column_list(1000,1000))); +(partition p0 values in ((0,0), (1,1)), + partition p1 values in ((1000,1000))); insert into t1 values (1000,1000); #select * from t1 where a = 0 and b = 0; drop table t1; create table t1 (a char, b char, c char) partition by range column_list(a,b,c) -( partition p0 values less than (column_list('a','b','c'))); +( partition p0 values less than ('a','b','c')); alter table t1 add partition -(partition p1 values less than (column_list('b','c','d'))); +(partition p1 values less than ('b','c','d')); drop table t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index a8758525342..629792a7153 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -11,8 +11,8 @@ drop table if exists t1; create table t1 (a varchar(5)) engine=memory partition by range column_list(a) -( partition p0 values less than (column_list('m')), - partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), + partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; @@ -20,8 +20,8 @@ drop table t1; create table t1 (a varchar(5)) engine=myisam partition by range column_list(a) -( partition p0 values less than (column_list('m')), - partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), + partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; @@ -29,8 +29,8 @@ drop table t1; create table t1 (a varchar(5)) engine=innodb partition by range column_list(a) -( partition p0 values less than (column_list('m')), - partition p1 values less than (column_list('za'))); +( partition p0 values less than ('m'), + partition p1 values less than ('za')); insert into t1 values ('j'); update t1 set a = 'z' where (a >= 'j'); drop table t1; diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index c14dfd1822d..76571861188 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -64,15 +64,15 @@ create table t1 (a int, b char(20)) partition by range column_list(a,b) (partition p0 values less than (1)); ---error ER_PARTITION_COLUMN_LIST_ERROR +--error ER_TOO_MANY_VALUES_ERROR create table t1 (a int, b char(20)) partition by range(a) -(partition p0 values less than (column_list(1,"b"))); +(partition p0 values less than (1,"b")); ---error ER_PARTITION_COLUMN_LIST_ERROR +--error ER_TOO_MANY_VALUES_ERROR create table t1 (a int, b char(20)) partition by range(a) -(partition p0 values less than (column_list(1,"b"))); +(partition p0 values less than (1,"b")); create table t1 (a int, b char(20)); create global index inx on t1 (a,b) @@ -82,7 +82,7 @@ drop table t1; create table t1 (a int, b char(20)) partition by range column_list(b) -(partition p0 values less than (column_list("b"))); +(partition p0 values less than ("b")); drop table t1; # |