Loading mysql-test/r/partition.result +8 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,14 @@ partition by key (a); select count(*) from t1; count(*) 0 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) drop table t1; CREATE TABLE t1 ( a int not null, Loading mysql-test/r/partition_range.result +34 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,14 @@ a b c 6 1 1 10 1 1 15 1 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) ALTER TABLE t1 partition by range (a) partitions 3 Loading @@ -31,6 +39,14 @@ a b c 6 1 1 10 1 1 15 1 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) drop table if exists t1; CREATE TABLE t1 ( a int not null, Loading Loading @@ -120,6 +136,24 @@ subpartition x22) ); SELECT * from t1; a b c show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) ALTER TABLE t1 ADD COLUMN d int; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, `d` int(11) default NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) drop table t1; CREATE TABLE t1 ( a int not null, Loading mysql-test/t/partition.test +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ partition by key (a); # select count(*) from t1; # # Test SHOW CREATE TABLE # show create table t1; drop table t1; # # Partition by key no partition, list of fields Loading mysql-test/t/partition_range.test +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ INSERT into t1 values (10, 1, 1); INSERT into t1 values (15, 1, 1); select * from t1; show create table t1; ALTER TABLE t1 partition by range (a) Loading @@ -39,6 +40,7 @@ partitions 3 partition x3 values less than maxvalue tablespace ts3); select * from t1; show create table t1; drop table if exists t1; Loading Loading @@ -143,6 +145,10 @@ subpartition by hash (a+b) ); SELECT * from t1; show create table t1; ALTER TABLE t1 ADD COLUMN d int; show create table t1; drop table t1; Loading sql/handler.h +1 −1 Original line number Diff line number Diff line Loading @@ -686,7 +686,7 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf, const key_range *key_spec, part_id_range *part_spec); bool mysql_unpack_partition(File file, THD *thd, uint part_info_len, TABLE *table); TABLE *table, enum db_type default_db_type); #endif Loading Loading
mysql-test/r/partition.result +8 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,14 @@ partition by key (a); select count(*) from t1; count(*) 0 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) drop table t1; CREATE TABLE t1 ( a int not null, Loading
mysql-test/r/partition_range.result +34 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,14 @@ a b c 6 1 1 10 1 1 15 1 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) ALTER TABLE t1 partition by range (a) partitions 3 Loading @@ -31,6 +39,14 @@ a b c 6 1 1 10 1 1 15 1 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) drop table if exists t1; CREATE TABLE t1 ( a int not null, Loading Loading @@ -120,6 +136,24 @@ subpartition x22) ); SELECT * from t1; a b c show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) ALTER TABLE t1 ADD COLUMN d int; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) NOT NULL, `c` int(11) NOT NULL, `d` int(11) default NULL, PRIMARY KEY (`a`,`b`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) drop table t1; CREATE TABLE t1 ( a int not null, Loading
mysql-test/t/partition.test +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,11 @@ partition by key (a); # select count(*) from t1; # # Test SHOW CREATE TABLE # show create table t1; drop table t1; # # Partition by key no partition, list of fields Loading
mysql-test/t/partition_range.test +6 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ INSERT into t1 values (10, 1, 1); INSERT into t1 values (15, 1, 1); select * from t1; show create table t1; ALTER TABLE t1 partition by range (a) Loading @@ -39,6 +40,7 @@ partitions 3 partition x3 values less than maxvalue tablespace ts3); select * from t1; show create table t1; drop table if exists t1; Loading Loading @@ -143,6 +145,10 @@ subpartition by hash (a+b) ); SELECT * from t1; show create table t1; ALTER TABLE t1 ADD COLUMN d int; show create table t1; drop table t1; Loading
sql/handler.h +1 −1 Original line number Diff line number Diff line Loading @@ -686,7 +686,7 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf, const key_range *key_spec, part_id_range *part_spec); bool mysql_unpack_partition(File file, THD *thd, uint part_info_len, TABLE *table); TABLE *table, enum db_type default_db_type); #endif Loading