1 create table t1 (a int) engine myisam
3 subpartition by hash (a)
4 (partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
5 (SUBPARTITION subpart00, SUBPARTITION subpart01));
6 # Checking if file exists before alter
7 ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
8 (partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
9 (SUBPARTITION subpart10, SUBPARTITION subpart11),
10 partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
11 (SUBPARTITION subpart20, SUBPARTITION subpart21));
12 # Checking if file exists after alter
14 set @org_mode=@@sql_mode;
15 set @@sql_mode='NO_DIR_IN_CREATE';
19 create table t1 (i int )
20 partition by range (i)
22 partition p01 values less than (1000)
23 data directory='/not/existing'
24 index directory='/not/existing'
27 Warning 1618 <DATA DIRECTORY> option ignored
28 Warning 1618 <INDEX DIRECTORY> option ignored
31 t2 CREATE TABLE `t2` (
32 `i` int(11) DEFAULT NULL
33 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
34 /*!50100 PARTITION BY RANGE (i)
35 (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
37 set @@sql_mode=@org_mode;
38 CREATE TABLE t1(a INT)
40 (PARTITION p0 DATA DIRECTORY 'MYSQLD_DATADIR/test');
41 ERROR HY000: Incorrect arguments to DATA DIRECTORY
42 CREATE TABLE t1(a INT)
44 (PARTITION p0 INDEX DIRECTORY 'MYSQLD_DATADIR/test');
45 ERROR HY000: Incorrect arguments to INDEX DIRECTORY
46 CREATE TABLE ts (id INT, purchased DATE)
47 PARTITION BY RANGE(YEAR(purchased))
48 SUBPARTITION BY HASH(TO_DAYS(purchased)) (
49 PARTITION p0 VALUES LESS THAN (1990) (
51 DATA DIRECTORY = 'MYSQLD_DATADIR/test',
53 DATA DIRECTORY = 'MYSQLD_DATADIR/test'
55 ERROR HY000: Incorrect arguments to DATA DIRECTORY
56 CREATE TABLE ts (id INT, purchased DATE)
57 PARTITION BY RANGE(YEAR(purchased))
58 SUBPARTITION BY HASH(TO_DAYS(purchased)) (
59 PARTITION p0 VALUES LESS THAN (1990) (
61 INDEX DIRECTORY = 'MYSQLD_DATADIR/test',
63 INDEX DIRECTORY = 'MYSQLD_DATADIR/test'
65 ERROR HY000: Incorrect arguments to INDEX DIRECTORY
66 DROP TABLE IF EXISTS `example`;
67 CREATE TABLE `example` (
68 `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
69 `DESCRIPTION` varchar(30) NOT NULL,
70 `LEVEL` smallint(5) unsigned DEFAULT NULL,
71 PRIMARY KEY (`ID_EXAMPLE`)
73 PARTITION BY HASH(ID_EXAMPLE)(
74 PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p0Data'
75 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p0Index',
76 PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p1Data'
77 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p1Index',
78 PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p2Data'
79 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p2Index',
80 PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p3Data'
81 INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p3Index'
83 # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
85 CREATE TABLE `example` (
86 `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
87 `DESCRIPTION` varchar(30) NOT NULL,
88 `LEVEL` smallint(5) unsigned DEFAULT NULL,
89 PRIMARY KEY (`ID_EXAMPLE`)
91 PARTITION BY HASH(ID_EXAMPLE)(
92 PARTITION p0 DATA DIRECTORY = '/not/existent/p0Data',
93 PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
94 PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
95 PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
97 Got one of the listed errors