2012-10-03 18:06:38 +00:00
|
|
|
SET DEFAULT_STORAGE_ENGINE='TokuDB';
|
2012-10-03 17:32:22 +00:00
|
|
|
DROP TABLE IF EXISTS foo;
|
|
|
|
SET SESSION tokudb_disable_slow_alter=1;
|
|
|
|
CREATE TABLE foo (a INT, b INT, PRIMARY KEY (a)) PARTITION BY HASH(a) PARTITIONS 2;
|
|
|
|
INSERT INTO foo VALUES (1,0),(2,0);
|
|
|
|
SHOW CREATE TABLE foo;
|
|
|
|
Table Create Table
|
|
|
|
foo CREATE TABLE `foo` (
|
|
|
|
`a` int(11) NOT NULL DEFAULT '0',
|
|
|
|
`b` int(11) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`a`)
|
|
|
|
) ENGINE=TokuDB DEFAULT CHARSET=latin1
|
|
|
|
/*!50100 PARTITION BY HASH (a)
|
|
|
|
PARTITIONS 2 */
|
|
|
|
ALTER TABLE foo ADD KEY(b);
|
|
|
|
SHOW CREATE TABLE foo;
|
|
|
|
Table Create Table
|
|
|
|
foo CREATE TABLE `foo` (
|
|
|
|
`a` int(11) NOT NULL DEFAULT '0',
|
|
|
|
`b` int(11) DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`a`),
|
|
|
|
KEY `b` (`b`)
|
|
|
|
) ENGINE=TokuDB DEFAULT CHARSET=latin1
|
|
|
|
/*!50100 PARTITION BY HASH (a)
|
|
|
|
PARTITIONS 2 */
|
|
|
|
DROP TABLE foo;
|