Commit e87883a0 authored by Mattias Jonsson's avatar Mattias Jonsson

merge

parents efc15a02 01a61865
...@@ -119,7 +119,10 @@ SHOW CREATE TABLE t1; ...@@ -119,7 +119,10 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
SUBPARTITION BY LINEAR HASH (a)
(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1"; table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD SUBPARTITION_METHOD
...@@ -134,7 +137,9 @@ SHOW CREATE TABLE t1; ...@@ -134,7 +137,9 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 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) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 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 SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1"; table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION PARTITION_DESCRIPTION
......
This diff is collapsed.
...@@ -60,7 +60,8 @@ show create table t1; ...@@ -60,7 +60,8 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) */ ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a) */
drop table t1; drop table t1;
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT, CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
f1 VARCHAR(25), f1 VARCHAR(25),
...@@ -84,7 +85,21 @@ t1 CREATE TABLE `t1` ( ...@@ -84,7 +85,21 @@ t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT, `id` mediumint(9) NOT NULL AUTO_INCREMENT,
`f1` varchar(25) DEFAULT NULL, `f1` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE, PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE, PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE, PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE, PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE, PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE, PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE, PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE, PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ ) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (id)
SUBPARTITION BY HASH (id)
SUBPARTITIONS 2
(PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE,
PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE,
PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE,
PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE,
PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE,
PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE,
PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE,
PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE,
PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE,
PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE,
PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
select count(*) from t1; select count(*) from t1;
count(*) count(*)
100 100
......
...@@ -326,7 +326,11 @@ Table Create Table ...@@ -326,7 +326,11 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bit(27) NOT NULL DEFAULT '\0\0\0\0', `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, PARTITION p2 ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
(PARTITION p0 ENGINE = MyISAM,
PARTITION p1 ENGINE = MyISAM,
PARTITION p2 ENGINE = MyISAM) */
insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
select hex(a) from t1 where a = 7; select hex(a) from t1 where a = 7;
hex(a) hex(a)
......
...@@ -137,7 +137,8 @@ show create table t1; ...@@ -137,7 +137,8 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
drop table t1; drop table t1;
create table t1 (a int) create table t1 (a int)
engine = innodb engine = innodb
...@@ -149,7 +150,9 @@ show create table t1; ...@@ -149,7 +150,9 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */ ) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
drop table t1; drop table t1;
create table t1 create table t1
( (
...@@ -225,5 +228,9 @@ Table Create Table ...@@ -225,5 +228,9 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`int_column` int(11) DEFAULT NULL, `int_column` int(11) DEFAULT NULL,
`char_column` char(5) DEFAULT NULL `char_column` char(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (int_column) SUBPARTITION BY KEY (char_column) SUBPARTITIONS 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (int_column)
SUBPARTITION BY KEY (char_column)
SUBPARTITIONS 2
(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
drop table t1; drop table t1;
...@@ -16,14 +16,18 @@ Table Create Table ...@@ -16,14 +16,18 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL, `f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL `f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date))
PARTITIONS 2 */
ALTER TABLE t1 COALESCE PARTITION 1; ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL, `f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL `f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date))
PARTITIONS 1 */
drop table t1; drop table t1;
create table t1 (a int) create table t1 (a int)
partition by list (a) partition by list (a)
...@@ -36,3 +40,42 @@ alter table t1 REORGANIZE partition p1 INTO ...@@ -36,3 +40,42 @@ alter table t1 REORGANIZE partition p1 INTO
(partition p11 values in (1,2), (partition p11 values in (1,2),
partition p12 values in (3,4)); partition p12 values in (3,4));
drop table t1; drop table t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
/* Test
of multi-line
comment */
PARTITIONS 5 */;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/' at line 6
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
...@@ -84,6 +84,14 @@ ALTER TABLE t1 DROP PARTITION x1; ...@@ -84,6 +84,14 @@ ALTER TABLE t1 DROP PARTITION x1;
ERROR HY000: Partition management on a not partitioned table is not possible ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 COALESCE PARTITION 1; ALTER TABLE t1 COALESCE PARTITION 1;
ERROR HY000: Partition management on a not partitioned table is not possible ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 ANALYZE PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 CHECK PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 OPTIMIZE PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 REPAIR PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int) CREATE TABLE t1 (a int)
PARTITION BY KEY (a) PARTITION BY KEY (a)
...@@ -136,7 +144,9 @@ SHOW CREATE TABLE t1; ...@@ -136,7 +144,9 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 2 */
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT) PARTITION BY HASH(a); CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
ALTER TABLE t1 ADD PARTITION PARTITIONS 4; ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
......
...@@ -30,7 +30,9 @@ show create table t2; ...@@ -30,7 +30,9 @@ show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (i)
(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@sql_mode=@org_mode; set @@sql_mode=@org_mode;
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
......
...@@ -8,7 +8,9 @@ show create table t1; ...@@ -8,7 +8,9 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
drop table t1; drop table t1;
create table t1 (a integer) create table t1 (a integer)
partition by range (a) partition by range (a)
...@@ -137,7 +139,11 @@ t1 CREATE TABLE `t1` ( ...@@ -137,7 +139,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 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) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 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 ALTER TABLE t1
partition by range (a) partition by range (a)
partitions 3 partitions 3
...@@ -157,7 +163,11 @@ t1 CREATE TABLE `t1` ( ...@@ -157,7 +163,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 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) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 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; drop table if exists t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int not null, a int not null,
...@@ -254,7 +264,15 @@ t1 CREATE TABLE `t1` ( ...@@ -254,7 +264,15 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 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)) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 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; ALTER TABLE t1 ADD COLUMN d int;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -264,7 +282,15 @@ t1 CREATE TABLE `t1` ( ...@@ -264,7 +282,15 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` int(11) DEFAULT NULL, `d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 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)) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 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; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int not null, a int not null,
...@@ -487,7 +513,10 @@ show create table t1; ...@@ -487,7 +513,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL `a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
drop table t1; drop table t1;
create table t1 (a bigint unsigned) create table t1 (a bigint unsigned)
partition by range (a) partition by range (a)
...@@ -497,7 +526,10 @@ show create table t1; ...@@ -497,7 +526,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL `a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
insert into t1 values (0xFFFFFFFFFFFFFFFF); insert into t1 values (0xFFFFFFFFFFFFFFFF);
ERROR HY000: Table has no partition for value 18446744073709551615 ERROR HY000: Table has no partition for value 18446744073709551615
drop table t1; drop table t1;
......
...@@ -107,7 +107,9 @@ show create table t2; ...@@ -107,7 +107,9 @@ show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (i)
(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@sql_mode=@org_mode; set @@sql_mode=@org_mode;
create table t1 (a int) create table t1 (a int)
......
...@@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` ( ...@@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL DEFAULT '0', `c` int(11) NOT NULL DEFAULT '0',
`d` int(11) DEFAULT NULL, `d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`) USING HASH PRIMARY KEY (`a`,`b`,`c`) USING HASH
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (b) */
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int not null primary key) CREATE TABLE t1 (a int not null primary key)
PARTITION BY KEY(a) PARTITION BY KEY(a)
...@@ -122,19 +123,28 @@ show create table t1; ...@@ -122,19 +123,28 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap; alter table t1 engine=heap;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */ ) ENGINE=MEMORY DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = MEMORY,
PARTITION p1 ENGINE = MEMORY) */
alter table t1 engine=ndb; alter table t1 engine=ndb;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap remove partitioning; alter table t1 engine=heap remove partitioning;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -148,7 +158,10 @@ show create table t1; ...@@ -148,7 +158,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 alter table t1
partition by key (a) partition by key (a)
(partition p0 engine=ndb, partition p1 engine=ndb); (partition p0 engine=ndb, partition p1 engine=ndb);
...@@ -156,7 +169,10 @@ show create table t1; ...@@ -156,7 +169,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 remove partitioning; alter table t1 remove partitioning;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -174,7 +190,10 @@ show create table t1; ...@@ -174,7 +190,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
c1 MEDIUMINT NOT NULL AUTO_INCREMENT, c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
......
...@@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` ( ...@@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`b`), PRIMARY KEY (`b`),
UNIQUE KEY `a` (`a`) UNIQUE KEY `a` (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (b)
(PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
drop table t1; drop table t1;
CREATE TABLE t1 CREATE TABLE t1
(id MEDIUMINT NOT NULL, (id MEDIUMINT NOT NULL,
......
...@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` ( ...@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 4 */
SHOW CREATE TABLE test.t2; SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
...@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` ( ...@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (c3)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3; SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
...@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` ( ...@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (c3)
(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4; SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
...@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` ( ...@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 2 */
SHOW CREATE TABLE test.t5; SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
...@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` ( ...@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (pk1)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6; SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
...@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` ( ...@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (pk1)
(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1'; SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
...@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` ( ...@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 4 */
SHOW CREATE TABLE test.t2; SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
...@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` ( ...@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (c3)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3; SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
...@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` ( ...@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (c3)
(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4; SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
...@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` ( ...@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 2 */
SHOW CREATE TABLE test.t5; SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
...@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` ( ...@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (pk1)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6; SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
...@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` ( ...@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (pk1)
(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1'; SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
......
...@@ -170,19 +170,22 @@ DROP TABLE t1; ...@@ -170,19 +170,22 @@ DROP TABLE t1;
#----------- PARTITION BY RANGE -- SUBPARTITION BY KEY #----------- PARTITION BY RANGE -- SUBPARTITION BY KEY
if ($with_partitioning) if ($with_partitioning)
{ {
let $partitioning= PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1) # use the new (from bug#14326) partitioning format (i.e. multi-line comments)
(PARTITION part1 VALUES LESS THAN (0) let $partitioning=
$data_directory /*!50100 PARTITION BY RANGE(f_int1)
(SUBPARTITION subpart11, SUBPARTITION subpart12), SUBPARTITION BY KEY(f_int1)
PARTITION part2 VALUES LESS THAN ($max_row_div4) (PARTITION part1 VALUES LESS THAN (0) $data_directory
$index_directory (SUBPARTITION subpart11,
(SUBPARTITION subpart21, SUBPARTITION subpart22), SUBPARTITION subpart12),
PARTITION part3 VALUES LESS THAN ($max_row_div2) PARTITION part2 VALUES LESS THAN ($max_row_div4) $index_directory
$data_directory (SUBPARTITION subpart21,
$index_directory SUBPARTITION subpart22),
(SUBPARTITION subpart31, SUBPARTITION subpart32), PARTITION part3 VALUES LESS THAN ($max_row_div2) $data_directory $index_directory
PARTITION part4 VALUES LESS THAN $MAX_VALUE (SUBPARTITION subpart31,
(SUBPARTITION subpart41, SUBPARTITION subpart42)); SUBPARTITION subpart32),
PARTITION part4 VALUES LESS THAN $MAX_VALUE
(SUBPARTITION subpart41,
SUBPARTITION subpart42)) */;
} }
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 ( eval CREATE TABLE t1 (
...@@ -198,32 +201,8 @@ DROP TABLE t1; ...@@ -198,32 +201,8 @@ DROP TABLE t1;
#----------- PARTITION BY LIST -- SUBPARTITION BY HASH #----------- PARTITION BY LIST -- SUBPARTITION BY HASH
if ($with_partitioning) if ($with_partitioning)
{ {
let $partitioning= # use the old (pre bug#14326) format (i.e. one line comment)
PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) let $partitioning= /*!50100 PARTITION BY LIST(ABS(MOD(f_int1,3))) SUBPARTITION BY HASH(f_int1 + 1) (PARTITION part1 VALUES IN (0) $index_directory (SUBPARTITION sp11 $data_directory, SUBPARTITION sp12 $index_directory), PARTITION part2 VALUES IN (1) $data_directory (SUBPARTITION sp21 $data_directory, SUBPARTITION sp22 $index_directory), PARTITION part3 VALUES IN (2) $data_directory $index_directory (SUBPARTITION sp31, SUBPARTITION sp32), PARTITION part4 VALUES IN (NULL) (SUBPARTITION sp41 $data_directory $index_directory, SUBPARTITION sp42 $data_directory $index_directory)) */;
(PARTITION part1 VALUES IN (0)
$index_directory
(SUBPARTITION sp11
$data_directory,
SUBPARTITION sp12
$index_directory),
PARTITION part2 VALUES IN (1)
$data_directory
(SUBPARTITION sp21
$data_directory,
SUBPARTITION sp22
$index_directory),
PARTITION part3 VALUES IN (2)
$data_directory
$index_directory
(SUBPARTITION sp31,
SUBPARTITION sp32),
PARTITION part4 VALUES IN (NULL)
(SUBPARTITION sp41
$data_directory
$index_directory,
SUBPARTITION sp42
$data_directory
$index_directory));
} }
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval CREATE TABLE t1 ( eval CREATE TABLE t1 (
......
...@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` ( ...@@ -175,7 +175,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 4 */
SHOW CREATE TABLE test.t2; SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
...@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` ( ...@@ -184,7 +186,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (c3)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3; SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
...@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` ( ...@@ -193,7 +198,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (c3)
(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4; SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
...@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` ( ...@@ -202,7 +211,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 2 */
SHOW CREATE TABLE test.t5; SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
...@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` ( ...@@ -211,7 +222,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (pk1)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6; SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
...@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` ( ...@@ -220,7 +234,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (pk1)
(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1'; SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
...@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` ( ...@@ -341,7 +358,9 @@ t1 CREATE TABLE `t1` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */ ) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 4 */
SHOW CREATE TABLE test.t2; SHOW CREATE TABLE test.t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
...@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` ( ...@@ -350,7 +369,10 @@ t2 CREATE TABLE `t2` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (c3)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t3; SHOW CREATE TABLE test.t3;
Table Create Table Table Create Table
t3 CREATE TABLE `t3` ( t3 CREATE TABLE `t3` (
...@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` ( ...@@ -359,7 +381,11 @@ t3 CREATE TABLE `t3` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (c3)
(PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t4; SHOW CREATE TABLE test.t4;
Table Create Table Table Create Table
t4 CREATE TABLE `t4` ( t4 CREATE TABLE `t4` (
...@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` ( ...@@ -368,7 +394,9 @@ t4 CREATE TABLE `t4` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 2 */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (c3)
PARTITIONS 2 */
SHOW CREATE TABLE test.t5; SHOW CREATE TABLE test.t5;
Table Create Table Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
...@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` ( ...@@ -377,7 +405,10 @@ t5 CREATE TABLE `t5` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (pk1) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (pk1)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
SHOW CREATE TABLE test.t6; SHOW CREATE TABLE test.t6;
Table Create Table Table Create Table
t6 CREATE TABLE `t6` ( t6 CREATE TABLE `t6` (
...@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` ( ...@@ -386,7 +417,10 @@ t6 CREATE TABLE `t6` (
`c3` int(11) NOT NULL, `c3` int(11) NOT NULL,
`c4` bit(1) NOT NULL, `c4` bit(1) NOT NULL,
PRIMARY KEY (`pk1`,`c3`) PRIMARY KEY (`pk1`,`c3`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (pk1) (PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (pk1)
(PARTITION x1 VALUES LESS THAN (333) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (720) ENGINE = ndbcluster) */
SELECT * FROM information_schema.partitions WHERE table_name= 't1'; SELECT * FROM information_schema.partitions WHERE table_name= 't1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1 NULL test t1 p0 NULL 1 NULL HASH NULL c3 NULL NULL 0 0 0 NULL 0 0 NULL NULL NULL NULL default table_space1
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment