2007-04-23 19:50:34 +02:00
|
|
|
create table t1 (a int) engine myisam
|
|
|
|
partition by range (a)
|
|
|
|
subpartition by hash (a)
|
2008-02-28 13:46:52 +01:00
|
|
|
(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
|
2007-04-23 19:50:34 +02:00
|
|
|
(SUBPARTITION subpart00, SUBPARTITION subpart01));
|
|
|
|
Checking if file exists before alter
|
|
|
|
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
|
2008-02-28 13:46:52 +01:00
|
|
|
(partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
|
2007-04-23 19:50:34 +02:00
|
|
|
(SUBPARTITION subpart10, SUBPARTITION subpart11),
|
2008-02-28 13:46:52 +01:00
|
|
|
partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
|
2007-04-23 19:50:34 +02:00
|
|
|
(SUBPARTITION subpart20, SUBPARTITION subpart21));
|
|
|
|
Checking if file exists after alter
|
|
|
|
drop table t1;
|
2008-03-03 12:38:18 +01:00
|
|
|
set @org_mode=@@sql_mode;
|
|
|
|
set @@sql_mode='NO_DIR_IN_CREATE';
|
|
|
|
select @@sql_mode;
|
|
|
|
@@sql_mode
|
|
|
|
NO_DIR_IN_CREATE
|
|
|
|
create table t1 (i int )
|
|
|
|
partition by range (i)
|
|
|
|
(
|
|
|
|
partition p01 values less than (1000)
|
|
|
|
data directory='/not/existing'
|
|
|
|
index directory='/not/existing'
|
|
|
|
);
|
|
|
|
show create table t2;
|
|
|
|
Table Create Table
|
|
|
|
t2 CREATE TABLE `t2` (
|
|
|
|
`i` int(11) DEFAULT NULL
|
|
|
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
|
|
|
|
DROP TABLE t1, t2;
|
|
|
|
set @@sql_mode=@org_mode;
|
2007-04-23 19:50:34 +02:00
|
|
|
DROP TABLE IF EXISTS `example`;
|
|
|
|
CREATE TABLE `example` (
|
|
|
|
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
|
`DESCRIPTION` varchar(30) NOT NULL,
|
|
|
|
`LEVEL` smallint(5) unsigned DEFAULT NULL,
|
|
|
|
PRIMARY KEY (`ID_EXAMPLE`)
|
|
|
|
) ENGINE = MYISAM
|
|
|
|
PARTITION BY HASH(ID_EXAMPLE)(
|
|
|
|
PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data',
|
|
|
|
PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data',
|
|
|
|
PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data',
|
|
|
|
PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data'
|
|
|
|
);
|
|
|
|
ERROR HY000: Can't create/write to file '/build/5.1/data/partitiontest/p0Data/example#P#p0.MYD' (Errcode: 2)
|