Loading mysql-test/r/information_schema_part.result +29 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,32 @@ NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default drop table t1; create table t1 (a int) PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ) select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; SUBPARTITION_METHOD LINEAR HASH drop table t1; create table t1 (a int) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = "test" AND table_name = "t1"; PARTITION_DESCRIPTION 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53 drop table t1; mysql-test/r/partition.result +12 −0 Original line number Diff line number Diff line Loading @@ -936,4 +936,16 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note The storage engine for the table doesn't support optimize drop table t1; create database db99; use db99; create table t1 (a int not null) engine=archive partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); create index inx on t1 (a); alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; End of 5.1 tests mysql-test/r/partition_error.result +23 −0 Original line number Diff line number Diff line Loading @@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5)); insert into t1 values (10); ERROR HY000: Table has no partition for value 10 drop table t1; create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); drop table t1; create table t1 (a int) partition by hash (rand(a)); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash(CURTIME() + a); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash (NOW()+a); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00'))); ERROR HY000: This partition function is not allowed create table t1 (a int) partition by range (a + (select count(*) from t1)) (partition p1 values less than (1)); ERROR HY000: This partition function is not allowed create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); ERROR HY000: The PARTITION function returns the wrong type mysql-test/t/information_schema_part.test +22 −0 Original line number Diff line number Diff line Loading @@ -99,3 +99,25 @@ select * from information_schema.partitions where table_schema="test" and table_name="t1"; drop table t1; # # Bug 20161 Partitions: SUBPARTITION METHOD doesn't show LINEAR keyword # create table t1 (a int) PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10)); SHOW CREATE TABLE t1; select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; drop table t1; create table t1 (a int) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)); SHOW CREATE TABLE t1; SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = "test" AND table_name = "t1"; drop table t1; mysql-test/t/partition.test +17 −0 Original line number Diff line number Diff line Loading @@ -1077,4 +1077,21 @@ OPTIMIZE TABLE t1; drop table t1; # # Bug 17310 Partitions: Bugs with archived partitioned tables # create database db99; use db99; create table t1 (a int not null) engine=archive partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); --error 0, 1005 create index inx on t1 (a); alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; --echo End of 5.1 tests Loading
mysql-test/r/information_schema_part.result +29 −0 Original line number Diff line number Diff line Loading @@ -111,3 +111,32 @@ NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default drop table t1; create table t1 (a int) PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ) select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; SUBPARTITION_METHOD LINEAR HASH drop table t1; create table t1 (a int) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = "test" AND table_name = "t1"; PARTITION_DESCRIPTION 10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53 drop table t1;
mysql-test/r/partition.result +12 −0 Original line number Diff line number Diff line Loading @@ -936,4 +936,16 @@ OPTIMIZE TABLE t1; Table Op Msg_type Msg_text test.t1 optimize note The storage engine for the table doesn't support optimize drop table t1; create database db99; use db99; create table t1 (a int not null) engine=archive partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); create index inx on t1 (a); alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; End of 5.1 tests
mysql-test/r/partition_error.result +23 −0 Original line number Diff line number Diff line Loading @@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5)); insert into t1 values (10); ERROR HY000: Table has no partition for value 10 drop table t1; create table t1 (v varchar(12)) partition by range (ascii(v)) (partition p0 values less than (10)); drop table t1; create table t1 (a int) partition by hash (rand(a)); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash(CURTIME() + a); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash (NOW()+a); ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2 create table t1 (a int) partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00'))); ERROR HY000: This partition function is not allowed create table t1 (a int) partition by range (a + (select count(*) from t1)) (partition p1 values less than (1)); ERROR HY000: This partition function is not allowed create table t1 (a char(10)) partition by hash (extractvalue(a,'a')); ERROR HY000: The PARTITION function returns the wrong type
mysql-test/t/information_schema_part.test +22 −0 Original line number Diff line number Diff line Loading @@ -99,3 +99,25 @@ select * from information_schema.partitions where table_schema="test" and table_name="t1"; drop table t1; # # Bug 20161 Partitions: SUBPARTITION METHOD doesn't show LINEAR keyword # create table t1 (a int) PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10)); SHOW CREATE TABLE t1; select SUBPARTITION_METHOD FROM information_schema.partitions WHERE table_schema="test" AND table_name="t1"; drop table t1; create table t1 (a int) PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31, 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53)); SHOW CREATE TABLE t1; SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE table_schema = "test" AND table_name = "t1"; drop table t1;
mysql-test/t/partition.test +17 −0 Original line number Diff line number Diff line Loading @@ -1077,4 +1077,21 @@ OPTIMIZE TABLE t1; drop table t1; # # Bug 17310 Partitions: Bugs with archived partitioned tables # create database db99; use db99; create table t1 (a int not null) engine=archive partition by list (a) (partition p0 values in (1), partition p1 values in (2)); insert into t1 values (1), (2); --error 0, 1005 create index inx on t1 (a); alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; --echo End of 5.1 tests