mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
bb1ad9ce08
The partitioning clause is only a very long single line, which is very hard to interpret for a human. This patch breaks the partitioning syntax into one line for the partitioning type, and one line per partition/subpartition. mysql-test/r/information_schema_part.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_archive.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_datatype.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_mgm.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_mgm_err.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_not_windows.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_range.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/r/partition_symlink.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/ndb/r/ndb_partition_key.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/ndb/r/ndb_partition_range.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/inc/partition_directory.inc: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Changed partitioning clause format for verifying the new output format. mysql-test/suite/parts/r/ndb_dd_backuprestore.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/part_supported_sql_func_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/part_supported_sql_func_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/part_supported_sql_func_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_1_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_1_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_2_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter1_2_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter2_1_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter2_1_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter2_2_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter2_2_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter3_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter3_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter4_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_alter4_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_archive.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_blackhole.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_memory.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_auto_increment_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_basic_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_basic_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_basic_symlink_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_basic_symlink_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_bit_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_bit_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_bit_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_char_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_char_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_datetime_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_datetime_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_decimal_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_decimal_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_engine_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_engine_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_engine_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_float_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_float_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_int_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_int_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_int_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc0_archive.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc0_memory.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc1_archive.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc1_memory.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc2_archive.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc2_memory.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_special_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_special_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_syntax_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/partition_syntax_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/parts/r/rpl_partition.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl/r/rpl_extraCol_innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl/r/rpl_extraCol_myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl/r/rpl_innodb_bug28430.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl/r/rpl_row_basic_8partition.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Updated test result due to the new partitioning clause output format. mysql-test/t/partition.test: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Added small tests for for the new partitioning clause output format. mysql-test/t/partition_mgm.test: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Added small tests for for the new partitioning clause output format. sql/sql_partition.cc: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Changed formatting of the partitioning clause from single line into multiple indented lines sql/sql_show.cc: Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output Changed formatting of the partitioning clause from single line into multiple indented lines
312 lines
7.6 KiB
Text
312 lines
7.6 KiB
Text
DROP TABLE IF EXISTS t1;
|
|
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (a,b);
|
|
insert into t1 values (1,1,1,1);
|
|
select * from t1;
|
|
a b c d
|
|
1 1 1 1
|
|
update t1 set d = 2 where a = 1 and b = 1 and c = 1;
|
|
select * from t1;
|
|
a b c d
|
|
1 1 1 2
|
|
delete from t1;
|
|
select * from t1;
|
|
a b c d
|
|
drop table t1;
|
|
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (c);
|
|
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
|
|
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
|
|
ENGINE = NDB
|
|
PARTITION BY KEY (a);
|
|
insert into t1 values
|
|
(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
|
|
(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
|
|
select * from t1 order by b;
|
|
a b c
|
|
1 1 3
|
|
1 2 3
|
|
1 3 3
|
|
1 4 3
|
|
1 5 3
|
|
1 6 3
|
|
1 7 3
|
|
1 8 3
|
|
1 9 3
|
|
1 10 3
|
|
1 11 3
|
|
1 12 3
|
|
select max(b) from t1 where a = 1;
|
|
max(b)
|
|
12
|
|
select b from t1 where a = 1 order by b desc;
|
|
b
|
|
12
|
|
11
|
|
10
|
|
9
|
|
8
|
|
7
|
|
6
|
|
5
|
|
4
|
|
3
|
|
2
|
|
1
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
|
|
PRIMARY KEY (a,b,c) USING HASH)
|
|
ENGINE=NDB
|
|
DEFAULT CHARSET=latin1
|
|
PARTITION BY KEY (b);
|
|
insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
|
|
-- t1 --
|
|
|
|
Fragment type: 5
|
|
K Value: 6
|
|
Min load factor: 78
|
|
Max load factor: 80
|
|
Temporary table: no
|
|
Number of attributes: 4
|
|
Number of primary keys: 3
|
|
Length of frm data: #
|
|
Row Checksum: 1
|
|
Row GCI: 1
|
|
SingleUserMode: 0
|
|
ForceVarPart: 1
|
|
TableStatus: Retrieved
|
|
-- Attributes --
|
|
a Int PRIMARY KEY AT=FIXED ST=MEMORY
|
|
b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
|
|
c Int PRIMARY KEY AT=FIXED ST=MEMORY
|
|
d Int NULL AT=FIXED ST=MEMORY
|
|
|
|
-- Indexes --
|
|
PRIMARY KEY(a, b, c) - UniqueHashIndex
|
|
|
|
|
|
NDBT_ProgramExit: 0 - OK
|
|
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) NOT NULL DEFAULT '0',
|
|
`b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
|
|
`c` int(11) NOT NULL DEFAULT '0',
|
|
`d` int(11) DEFAULT NULL,
|
|
PRIMARY KEY (`a`,`b`,`c`) USING HASH
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (b) */
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a int not null primary key)
|
|
PARTITION BY KEY(a)
|
|
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
|
|
drop table t1;
|
|
CREATE TABLE t1 (a int not null primary key);
|
|
ALTER TABLE t1
|
|
ENGINE = NDB
|
|
PARTITION BY KEY(a)
|
|
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
|
|
drop table t1;
|
|
CREATE TABLE t1 (a int not null primary key) ENGINE = NDB;
|
|
ALTER TABLE t1
|
|
PARTITION BY KEY(a)
|
|
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
|
|
drop table t1;
|
|
create table t1 (a int)
|
|
engine=ndb
|
|
partition by key(a)
|
|
(partition p0, partition p1);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (a)
|
|
(PARTITION p0 ENGINE = ndbcluster,
|
|
PARTITION p1 ENGINE = ndbcluster) */
|
|
alter table t1 engine=heap;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (a)
|
|
(PARTITION p0 ENGINE = MEMORY,
|
|
PARTITION p1 ENGINE = MEMORY) */
|
|
alter table t1 engine=ndb;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) 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;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=MEMORY DEFAULT CHARSET=latin1
|
|
alter table t1 engine=ndb
|
|
partition by key(a)
|
|
(partition p0, partition p1 engine = ndb);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (a)
|
|
(PARTITION p0 ENGINE = ndbcluster,
|
|
PARTITION p1 ENGINE = ndbcluster) */
|
|
alter table t1
|
|
partition by key (a)
|
|
(partition p0 engine=ndb, partition p1 engine=ndb);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (a)
|
|
(PARTITION p0 ENGINE = ndbcluster,
|
|
PARTITION p1 ENGINE = ndbcluster) */
|
|
alter table t1 remove partitioning;
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
alter table t1
|
|
partition by key(a)
|
|
(partition p0 engine=ndb, partition p1);
|
|
alter table t1
|
|
engine=ndb
|
|
partition by key(a)
|
|
(partition p0 engine=ndb, partition p1 engine = ndb);
|
|
show create table t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` int(11) DEFAULT NULL
|
|
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
|
/*!50100 PARTITION BY KEY (a)
|
|
(PARTITION p0 ENGINE = ndbcluster,
|
|
PARTITION p1 ENGINE = ndbcluster) */
|
|
drop table t1;
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
c4 BIT NOT NULL,
|
|
c5 FLOAT,
|
|
c6 VARCHAR(255),
|
|
c7 TIMESTAMP,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3) PARTITIONS 5;
|
|
ALTER TABLE t1 COALESCE PARTITION 4;
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (a int primary key)
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(a);
|
|
ANALYZE TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 analyze note The storage engine for the table doesn't support analyze
|
|
CHECK TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check note The storage engine for the table doesn't support check
|
|
OPTIMIZE TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 optimize note The storage engine for the table doesn't support optimize
|
|
REPAIR TABLE t1;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 repair note The storage engine for the table doesn't support repair
|
|
ALTER TABLE t1 OPTIMIZE PARTITION p0;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 optimize note The storage engine for the table doesn't support optimize
|
|
ALTER TABLE t1 CHECK PARTITION p0;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 check note The storage engine for the table doesn't support check
|
|
ALTER TABLE t1 REPAIR PARTITION p0;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 repair note The storage engine for the table doesn't support repair
|
|
ALTER TABLE t1 ANALYZE PARTITION p0;
|
|
Table Op Msg_type Msg_text
|
|
test.t1 analyze note The storage engine for the table doesn't support analyze
|
|
ALTER TABLE t1 REBUILD PARTITION p0;
|
|
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3) PARTITIONS 5;
|
|
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (
|
|
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
|
|
c2 TEXT NOT NULL,
|
|
c3 INT NOT NULL,
|
|
PRIMARY KEY(c1,c3))
|
|
ENGINE=NDB
|
|
PARTITION BY KEY(c3)
|
|
(PARTITION p0 NODEGROUP 0, PARTITION p1 NODEGROUP 0);
|
|
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
|
|
SELECT NODEGROUP,PARTITION_NAME FROM information_schema.partitions WHERE
|
|
table_name = "t1";
|
|
NODEGROUP PARTITION_NAME
|
|
0 p0
|
|
0 p1
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1 (
|
|
a tinyint unsigned NOT NULL,
|
|
b bigint(20) unsigned NOT NULL,
|
|
c char(12),
|
|
PRIMARY KEY (a,b)
|
|
) ENGINE ndb DEFAULT CHARSET=latin1 PARTITION BY KEY (a);
|
|
insert into t1 values(1,1,'1'), (2,2,'2'), (3,3,'3'), (4,4,'4'), (5,5,'5');
|
|
select * from t1 where a = 1;
|
|
a b c
|
|
1 1 1
|
|
select * from t1 where a = 2;
|
|
a b c
|
|
2 2 2
|
|
select * from t1 where a = 3;
|
|
a b c
|
|
3 3 3
|
|
select * from t1 where a = 4;
|
|
a b c
|
|
4 4 4
|
|
select * from t1 where a = 5;
|
|
a b c
|
|
5 5 5
|
|
delete from t1 where a = 1;
|
|
select * from t1 order by 1;
|
|
a b c
|
|
2 2 2
|
|
3 3 3
|
|
4 4 4
|
|
5 5 5
|
|
delete from t1 where a = 2;
|
|
select * from t1 order by 1;
|
|
a b c
|
|
3 3 3
|
|
4 4 4
|
|
5 5 5
|
|
delete from t1 where a = 3;
|
|
select * from t1 order by 1;
|
|
a b c
|
|
4 4 4
|
|
5 5 5
|
|
delete from t1 where a = 4;
|
|
select * from t1 order by 1;
|
|
a b c
|
|
5 5 5
|
|
delete from t1 where a = 5;
|
|
select * from t1 order by 1;
|
|
a b c
|
|
drop table t1;
|