Commit 166357b5 authored by unknown's avatar unknown

Bug#35305: partition_symlink test failures

Updated the test due to bug 32167

Corrected spelling of error message


mysql-test/r/partition_not_windows.result:
  Updated test result due to test case changes and corrected spelling error
mysql-test/r/partition_symlink.result:
  Bug#35305: partition_symlink test failure
  
  Updated test result due to test case changes
mysql-test/r/symlink.result:
  Updated test result due to test case changes and corrected spelling error
mysql-test/t/disabled.def:
  Bug#35305: partition_symlink test failure
  
  Enable the test after it has been fixed
mysql-test/t/partition_not_windows.test:
  Removed disable/enable_query_log for better result files
mysql-test/t/partition_symlink.test:
  Bug#35305: partition_symlink test failure
  
  Changes due to bug 32167
mysql-test/t/symlink.test:
  using replace_result instead of disable_query_log
sql/partition_info.cc:
  corrected spelling
sql/sql_parse.cc:
  corrected spelling
parent 1bb10ccf
...@@ -3,13 +3,13 @@ partition by range (a) ...@@ -3,13 +3,13 @@ partition by range (a)
subpartition by hash (a) subpartition by hash (a)
(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' (partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart00, SUBPARTITION subpart01)); (SUBPARTITION subpart00, SUBPARTITION subpart01));
Checking if file exists before alter # Checking if file exists before alter
ALTER TABLE t1 REORGANIZE PARTITION p0 INTO ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
(partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' (partition p1 VALUES LESS THAN (1) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart10, SUBPARTITION subpart11), (SUBPARTITION subpart10, SUBPARTITION subpart11),
partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp' partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/tmp'
(SUBPARTITION subpart20, SUBPARTITION subpart21)); (SUBPARTITION subpart20, SUBPARTITION subpart21));
Checking if file exists after alter # Checking if file exists after alter
drop table t1; drop table t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
set @@sql_mode='NO_DIR_IN_CREATE'; set @@sql_mode='NO_DIR_IN_CREATE';
...@@ -36,11 +36,11 @@ set @@sql_mode=@org_mode; ...@@ -36,11 +36,11 @@ set @@sql_mode=@org_mode;
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
PARTITION BY KEY (a) PARTITION BY KEY (a)
(PARTITION p0 DATA DIRECTORY 'TEST_DIR/master-data/test'); (PARTITION p0 DATA DIRECTORY 'TEST_DIR/master-data/test');
ERROR HY000: Incorrect arguments to DATA DIRECORY ERROR HY000: Incorrect arguments to DATA DIRECTORY
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
PARTITION BY KEY (a) PARTITION BY KEY (a)
(PARTITION p0 INDEX DIRECTORY 'TEST_DIR/master-data/test'); (PARTITION p0 INDEX DIRECTORY 'TEST_DIR/master-data/test');
ERROR HY000: Incorrect arguments to INDEX DIRECORY ERROR HY000: Incorrect arguments to INDEX DIRECTORY
CREATE TABLE ts (id INT, purchased DATE) CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased)) PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) ( SUBPARTITION BY HASH(TO_DAYS(purchased)) (
...@@ -50,7 +50,7 @@ DATA DIRECTORY = 'TEST_DIR/master-data/test', ...@@ -50,7 +50,7 @@ DATA DIRECTORY = 'TEST_DIR/master-data/test',
SUBPARTITION s0b SUBPARTITION s0b
DATA DIRECTORY = 'TEST_DIR/master-data/test' DATA DIRECTORY = 'TEST_DIR/master-data/test'
)); ));
ERROR HY000: Incorrect arguments to DATA DIRECORY ERROR HY000: Incorrect arguments to DATA DIRECTORY
CREATE TABLE ts (id INT, purchased DATE) CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased)) PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) ( SUBPARTITION BY HASH(TO_DAYS(purchased)) (
...@@ -60,7 +60,7 @@ INDEX DIRECTORY = 'TEST_DIR/master-data/test', ...@@ -60,7 +60,7 @@ INDEX DIRECTORY = 'TEST_DIR/master-data/test',
SUBPARTITION s0b SUBPARTITION s0b
INDEX DIRECTORY = 'TEST_DIR/master-data/test' INDEX DIRECTORY = 'TEST_DIR/master-data/test'
)); ));
ERROR HY000: Incorrect arguments to INDEX DIRECORY ERROR HY000: Incorrect arguments to INDEX DIRECTORY
DROP TABLE IF EXISTS `example`; DROP TABLE IF EXISTS `example`;
CREATE TABLE `example` ( CREATE TABLE `example` (
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
...@@ -69,9 +69,27 @@ CREATE TABLE `example` ( ...@@ -69,9 +69,27 @@ CREATE TABLE `example` (
PRIMARY KEY (`ID_EXAMPLE`) PRIMARY KEY (`ID_EXAMPLE`)
) ENGINE = MYISAM ) ENGINE = MYISAM
PARTITION BY HASH(ID_EXAMPLE)( PARTITION BY HASH(ID_EXAMPLE)(
PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data', PARTITION p0 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p0Data'
PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data', INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p0Index',
PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data', PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p1Data'
PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data' INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p1Index',
PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p2Data'
INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p2Index',
PARTITION p3 DATA DIRECTORY = 'MYSQLTEST_VARDIR/p3Data'
INDEX DIRECTORY = 'MYSQLTEST_VARDIR/p3Index'
); );
ERROR HY000: Can't create/write to file '/build/5.1/data/partitiontest/p0Data/example#P#p0.MYD' (Errcode: 2) # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
DROP TABLE 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 = '/not/existent/p0Data',
PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
);
Got one of the listed errors
...@@ -81,6 +81,13 @@ Got one of the listed errors ...@@ -81,6 +81,13 @@ Got one of the listed errors
DROP DATABASE mysqltest2; DROP DATABASE mysqltest2;
USE test; USE test;
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
create table t2 (i int )
partition by range (i)
(
partition p01 values less than (1000)
data directory="MYSQLTEST_VARDIR/tmp"
index directory="MYSQLTEST_VARDIR/tmp"
);
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
set @@sql_mode='NO_DIR_IN_CREATE'; set @@sql_mode='NO_DIR_IN_CREATE';
select @@sql_mode; select @@sql_mode;
......
...@@ -22,6 +22,7 @@ insert into t1 (b) select b from t2; ...@@ -22,6 +22,7 @@ insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1; insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2; insert into t1 (b) select b from t2;
drop table t2; drop table t2;
create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp" index directory="MYSQLTEST_VARDIR/run";
insert into t9 select * from t1; insert into t9 select * from t1;
check table t9; check table t9;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
...@@ -54,10 +55,16 @@ t9 CREATE TABLE `t9` ( ...@@ -54,10 +55,16 @@ t9 CREATE TABLE `t9` (
`d` int(11) NOT NULL, `d` int(11) NOT NULL,
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/' ) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
Got one of the listed errors Got one of the listed errors
create database mysqltest;
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="/this-dir-does-not-exist";
Got one of the listed errors Got one of the listed errors
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
Got one of the listed errors Got one of the listed errors
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="MYSQLTEST_VARDIR/run";
Got one of the listed errors Got one of the listed errors
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="MYSQLTEST_VARDIR/tmp";
Got one of the listed errors Got one of the listed errors
alter table t9 rename mysqltest.t9; alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9; select count(*) from mysqltest.t9;
...@@ -74,6 +81,7 @@ t9 CREATE TABLE `t9` ( ...@@ -74,6 +81,7 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/' ) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
drop database mysqltest; drop database mysqltest;
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
alter table t1 data directory="MYSQLTEST_VARDIR/tmp";
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 0 DATA DIRECTORY option ignored
show create table t1; show create table t1;
...@@ -82,6 +90,7 @@ t1 CREATE TABLE `t1` ( ...@@ -82,6 +90,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL `a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int; alter table t1 add b int;
alter table t1 data directory="MYSQLTEST_VARDIR/log";
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 0 DATA DIRECTORY option ignored
show create table t1; show create table t1;
...@@ -90,6 +99,7 @@ t1 CREATE TABLE `t1` ( ...@@ -90,6 +99,7 @@ t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL, `a` int(11) NOT NULL,
`b` int(11) DEFAULT NULL `b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 index directory="MYSQLTEST_VARDIR/log";
Warnings: Warnings:
Warning 0 INDEX DIRECTORY option ignored Warning 0 INDEX DIRECTORY option ignored
show create table t1; show create table t1;
...@@ -102,18 +112,20 @@ drop table t1; ...@@ -102,18 +112,20 @@ drop table t1;
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/tmp' DATA DIRECTORY='TEST_DIR/tmp'
INDEX DIRECTORY='TEST_DIR/tmp'; INDEX DIRECTORY='TEST_DIR/tmp';
ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17) Got one of the listed errors
CREATE TABLE t2(a INT) CREATE TABLE t2(a INT)
DATA DIRECTORY='TEST_DIR/tmp' DATA DIRECTORY='TEST_DIR/tmp'
INDEX DIRECTORY='TEST_DIR/tmp'; INDEX DIRECTORY='TEST_DIR/tmp';
RENAME TABLE t2 TO t1; RENAME TABLE t2 TO t1;
ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17) ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17)
DROP TABLE t2; DROP TABLE t2;
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 9 a;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TEMPORARY TABLE `t1` ( t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 99 a;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TEMPORARY TABLE `t1` ( t1 CREATE TEMPORARY TABLE `t1` (
...@@ -140,10 +152,10 @@ DROP TABLE t1; ...@@ -140,10 +152,10 @@ DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data/mysql'; INDEX DIRECTORY='TEST_DIR/master-data/mysql';
ERROR HY000: Incorrect arguments to INDEX DIRECORY ERROR HY000: Incorrect arguments to INDEX DIRECTORY
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/test'; DATA DIRECTORY='TEST_DIR/master-data/test';
ERROR HY000: Incorrect arguments to DATA DIRECORY ERROR HY000: Incorrect arguments to DATA DIRECTORY
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/'; DATA DIRECTORY='TEST_DIR/master-data/';
DROP TABLE t1; DROP TABLE t1;
......
...@@ -21,4 +21,3 @@ ctype_create : Bug#32965 main.ctype_create fails ...@@ -21,4 +21,3 @@ ctype_create : Bug#32965 main.ctype_create fails
status : Bug#32966 main.status fails status : Bug#32966 main.status fails
ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166 ps_ddl : Bug#12093 2007-12-14 pending WL#4165 / WL#4166
csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables csv_alter_table : Bug#33696 2008-01-21 pcrews no .result file - bug allows NULL columns in CSV tables
partition_symlink : Bug#35305 Make pushbuild green
...@@ -11,13 +11,9 @@ ...@@ -11,13 +11,9 @@
# Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize # Bug 20770 Partitions: DATA DIRECTORY clause change in reorganize
# doesn't remove old directory # doesn't remove old directory
--disable_query_log let $data_directory = DATA DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
eval SET @data_dir = 'DATA DIRECTORY = ''$MYSQLTEST_VARDIR/tmp''';
let $data_directory = `select @data_dir`;
eval SET @inx_dir = 'INDEX DIRECTORY = ''$MYSQLTEST_VARDIR/tmp'''; let $inx_directory = INDEX DIRECTORY = '$MYSQLTEST_VARDIR/tmp';
let $inx_directory = `select @inx_dir`;
--enable_query_log
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t1 (a int) engine myisam eval create table t1 (a int) engine myisam
...@@ -26,7 +22,7 @@ subpartition by hash (a) ...@@ -26,7 +22,7 @@ subpartition by hash (a)
(partition p0 VALUES LESS THAN (1) $data_directory $inx_directory (partition p0 VALUES LESS THAN (1) $data_directory $inx_directory
(SUBPARTITION subpart00, SUBPARTITION subpart01)); (SUBPARTITION subpart00, SUBPARTITION subpart01));
--echo Checking if file exists before alter --echo # Checking if file exists before alter
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p0#SP#subpart00.MYD
...@@ -45,7 +41,7 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO ...@@ -45,7 +41,7 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
partition p2 VALUES LESS THAN (2) $data_directory $inx_directory partition p2 VALUES LESS THAN (2) $data_directory $inx_directory
(SUBPARTITION subpart20, SUBPARTITION subpart21)); (SUBPARTITION subpart20, SUBPARTITION subpart21));
--echo Checking if file exists after alter --echo # Checking if file exists after alter
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.frm
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par --file_exists $MYSQLTEST_VARDIR/master-data/test/t1.par
--file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD --file_exists $MYSQLTEST_VARDIR/master-data/test/t1#P#p1#SP#subpart10.MYD
...@@ -98,18 +94,18 @@ set @@sql_mode=@org_mode; ...@@ -98,18 +94,18 @@ set @@sql_mode=@org_mode;
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY # Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
# #
--replace_result $MYSQLTEST_VARDIR TEST_DIR --replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1210 --error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT) eval CREATE TABLE t1(a INT)
PARTITION BY KEY (a) PARTITION BY KEY (a)
(PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); (PARTITION p0 DATA DIRECTORY '$MYSQLTEST_VARDIR/master-data/test');
--replace_result $MYSQLTEST_VARDIR TEST_DIR --replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1210 --error ER_WRONG_ARGUMENTS
eval CREATE TABLE t1(a INT) eval CREATE TABLE t1(a INT)
PARTITION BY KEY (a) PARTITION BY KEY (a)
(PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test'); (PARTITION p0 INDEX DIRECTORY '$MYSQLTEST_VARDIR/master-data/test');
--replace_result $MYSQLTEST_VARDIR TEST_DIR --replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1210 --error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE) eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased)) PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) ( SUBPARTITION BY HASH(TO_DAYS(purchased)) (
...@@ -121,7 +117,7 @@ SUBPARTITION s0b ...@@ -121,7 +117,7 @@ SUBPARTITION s0b
)); ));
--replace_result $MYSQLTEST_VARDIR TEST_DIR --replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1210 --error ER_WRONG_ARGUMENTS
eval CREATE TABLE ts (id INT, purchased DATE) eval CREATE TABLE ts (id INT, purchased DATE)
PARTITION BY RANGE(YEAR(purchased)) PARTITION BY RANGE(YEAR(purchased))
SUBPARTITION BY HASH(TO_DAYS(purchased)) ( SUBPARTITION BY HASH(TO_DAYS(purchased)) (
...@@ -144,7 +140,59 @@ SUBPARTITION s0b ...@@ -144,7 +140,59 @@ SUBPARTITION s0b
DROP TABLE IF EXISTS `example`; DROP TABLE IF EXISTS `example`;
--enable_warnings --enable_warnings
--disable_abort_on_error --mkdir $MYSQLTEST_VARDIR/p0Data
--mkdir $MYSQLTEST_VARDIR/p1Data
--mkdir $MYSQLTEST_VARDIR/p2Data
--mkdir $MYSQLTEST_VARDIR/p3Data
--mkdir $MYSQLTEST_VARDIR/p0Index
--mkdir $MYSQLTEST_VARDIR/p1Index
--mkdir $MYSQLTEST_VARDIR/p2Index
--mkdir $MYSQLTEST_VARDIR/p3Index
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval 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 = '$MYSQLTEST_VARDIR/p0Data'
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p0Index',
PARTITION p1 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p1Data'
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p1Index',
PARTITION p2 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p2Data'
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p2Index',
PARTITION p3 DATA DIRECTORY = '$MYSQLTEST_VARDIR/p3Data'
INDEX DIRECTORY = '$MYSQLTEST_VARDIR/p3Index'
);
--echo # Checking that MyISAM .MYD and .MYI are in test db and data/idx dir
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p0.MYD
--file_exists $MYSQLTEST_VARDIR/p0Data/example#P#p0.MYD
--file_exists $MYSQLTEST_VARDIR/p0Index/example#P#p0.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p1.MYD
--file_exists $MYSQLTEST_VARDIR/p1Data/example#P#p1.MYD
--file_exists $MYSQLTEST_VARDIR/p1Index/example#P#p1.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p2.MYD
--file_exists $MYSQLTEST_VARDIR/p2Data/example#P#p2.MYD
--file_exists $MYSQLTEST_VARDIR/p2Index/example#P#p2.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYI
--file_exists $MYSQLTEST_VARDIR/master-data/test/example#P#p3.MYD
--file_exists $MYSQLTEST_VARDIR/p3Data/example#P#p3.MYD
--file_exists $MYSQLTEST_VARDIR/p3Index/example#P#p3.MYI
DROP TABLE example;
--rmdir $MYSQLTEST_VARDIR/p0Data
--rmdir $MYSQLTEST_VARDIR/p1Data
--rmdir $MYSQLTEST_VARDIR/p2Data
--rmdir $MYSQLTEST_VARDIR/p3Data
--rmdir $MYSQLTEST_VARDIR/p0Index
--rmdir $MYSQLTEST_VARDIR/p1Index
--rmdir $MYSQLTEST_VARDIR/p2Index
--rmdir $MYSQLTEST_VARDIR/p3Index
--error ER_CANT_CREATE_TABLE,1
CREATE TABLE `example` ( CREATE TABLE `example` (
`ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT, `ID_EXAMPLE` int(10) unsigned NOT NULL AUTO_INCREMENT,
`DESCRIPTION` varchar(30) NOT NULL, `DESCRIPTION` varchar(30) NOT NULL,
...@@ -152,10 +200,8 @@ CREATE TABLE `example` ( ...@@ -152,10 +200,8 @@ CREATE TABLE `example` (
PRIMARY KEY (`ID_EXAMPLE`) PRIMARY KEY (`ID_EXAMPLE`)
) ENGINE = MYISAM ) ENGINE = MYISAM
PARTITION BY HASH(ID_EXAMPLE)( PARTITION BY HASH(ID_EXAMPLE)(
PARTITION p0 DATA DIRECTORY = '/build/5.1/data/partitiontest/p0Data', PARTITION p0 DATA DIRECTORY = '/not/existent/p0Data',
PARTITION p1 DATA DIRECTORY = '/build/5.1/data/partitiontest/p1Data', PARTITION p1 DATA DIRECTORY = '/not/existent/p1Data',
PARTITION p2 DATA DIRECTORY = '/build/5.1/data/partitiontest/p2Data', PARTITION p2 DATA DIRECTORY = '/not/existent/p2Data',
PARTITION p3 DATA DIRECTORY = '/build/5.1/data/partitiontest/p3Data' PARTITION p3 DATA DIRECTORY = '/not/existent/p3Data'
); );
--enable_abort_on_error
...@@ -27,9 +27,6 @@ DROP DATABASE IF EXISTS mysqltest2; ...@@ -27,9 +27,6 @@ DROP DATABASE IF EXISTS mysqltest2;
# directory or file that the mysqld-process can use, via DATA/INDEX DIR) # directory or file that the mysqld-process can use, via DATA/INDEX DIR)
# this is the security flaw that was used in bug#32091 and bug#32111 # this is the security flaw that was used in bug#32091 and bug#32111
#--exec mkdir $MYSQLTEST_VARDIR/tmp/test || true
#--exec mkdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true
-- echo # Creating two non colliding tables mysqltest2.t1 and test.t1 -- echo # Creating two non colliding tables mysqltest2.t1 and test.t1
-- echo # test.t1 have partitions in mysqltest2-directory! -- echo # test.t1 have partitions in mysqltest2-directory!
-- echo # user root: -- echo # user root:
...@@ -125,22 +122,18 @@ connection default; ...@@ -125,22 +122,18 @@ connection default;
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
disconnect con1; disconnect con1;
#--exec rmdir $MYSQLTEST_VARDIR/tmp/test || true
#--exec rmdir $MYSQLTEST_VARDIR/tmp/mysqltest2 || true
# #
# Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables # Bug #24633 SQL MODE "NO_DIR_IN_CREATE" does not work with partitioned tables
# #
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t2 (i int ) eval create table t2 (i int )
partition by range (i) partition by range (i)
( (
partition p01 values less than (1000) partition p01 values less than (1000)
data directory="$MYSQLTEST_VARDIR/master-data/test/" data directory="$MYSQLTEST_VARDIR/tmp"
index directory="$MYSQLTEST_VARDIR/master-data/test/" index directory="$MYSQLTEST_VARDIR/tmp"
); );
enable_query_log;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
set @@sql_mode='NO_DIR_IN_CREATE'; set @@sql_mode='NO_DIR_IN_CREATE';
...@@ -153,6 +146,7 @@ partition by range (i) ...@@ -153,6 +146,7 @@ partition by range (i)
index directory='/not/existing' index directory='/not/existing'
); );
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t2; show create table t2;
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@sql_mode=@org_mode; set @@sql_mode=@org_mode;
......
...@@ -38,9 +38,8 @@ drop table t2; ...@@ -38,9 +38,8 @@ drop table t2;
# We use t9 here to not crash with tables generated by the backup test # We use t9 here to not crash with tables generated by the backup test
# #
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run"; eval create table t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp" index directory="$MYSQLTEST_VARDIR/run";
enable_query_log;
insert into t9 select * from t1; insert into t9 select * from t1;
check table t9; check table t9;
...@@ -66,7 +65,6 @@ drop table t1; ...@@ -66,7 +65,6 @@ drop table t1;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
SHOW CREATE TABLE t9; SHOW CREATE TABLE t9;
disable_query_log;
--error 1103,1103 --error 1103,1103
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp"; create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
...@@ -81,13 +79,14 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p ...@@ -81,13 +79,14 @@ create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, p
create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path"; create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
# Should fail becasue the file t9.MYI already exist in 'run' # Should fail becasue the file t9.MYI already exist in 'run'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1,1,1105 --error 1,1,1105
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run"; eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run";
# Should fail becasue the file t9.MYD already exist in 'tmp' # Should fail becasue the file t9.MYD already exist in 'tmp'
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1,1 --error 1,1
eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp"; eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="$MYSQLTEST_VARDIR/tmp";
enable_query_log;
# Check moving table t9 from default database to mysqltest; # Check moving table t9 from default database to mysqltest;
# In this case the symlinks should be removed. # In this case the symlinks should be removed.
...@@ -103,20 +102,17 @@ drop database mysqltest; ...@@ -103,20 +102,17 @@ drop database mysqltest;
# #
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp"; eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
enable_query_log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
alter table t1 add b int; alter table t1 add b int;
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 data directory="$MYSQLTEST_VARDIR/log"; eval alter table t1 data directory="$MYSQLTEST_VARDIR/log";
enable_query_log;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval alter table t1 index directory="$MYSQLTEST_VARDIR/log"; eval alter table t1 index directory="$MYSQLTEST_VARDIR/log";
enable_query_log;
show create table t1; show create table t1;
drop table t1; drop table t1;
...@@ -125,8 +121,9 @@ drop table t1; ...@@ -125,8 +121,9 @@ drop table t1;
# #
--write_file $MYSQLTEST_VARDIR/tmp/t1.MYI --write_file $MYSQLTEST_VARDIR/tmp/t1.MYI
EOF EOF
--replace_result $MYSQLTEST_VARDIR TEST_DIR
--error 1 --replace_result $MYSQLTEST_VARDIR TEST_DIR $MYSQLTEST_VARDIR TEST_DIR
--error 1,1
eval CREATE TABLE t1(a INT) eval CREATE TABLE t1(a INT)
DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp'
INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp'; INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
...@@ -147,18 +144,16 @@ connect (session1,localhost,root,,); ...@@ -147,18 +144,16 @@ connect (session1,localhost,root,,);
connect (session2,localhost,root,,); connect (session2,localhost,root,,);
connection session1; connection session1;
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a; eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a;
enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table" # If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out # will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
show create table t1; show create table t1;
connection session2; connection session2;
disable_query_log; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a; eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a;
enable_query_log;
# If running test suite with a non standard tmp dir, the "show create table" # If running test suite with a non standard tmp dir, the "show create table"
# will print "DATA_DIRECTORY=". Use replace_result to mask it out # will print "DATA_DIRECTORY=". Use replace_result to mask it out
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
......
...@@ -1312,11 +1312,11 @@ bool check_partition_dirs(partition_info *part_info) ...@@ -1312,11 +1312,11 @@ bool check_partition_dirs(partition_info *part_info)
return 0; return 0;
dd_err: dd_err:
my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECORY"); my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECTORY");
return 1; return 1;
id_err: id_err:
my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECORY"); my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECTORY");
return 1; return 1;
} }
......
...@@ -2354,13 +2354,13 @@ mysql_execute_command(THD *thd) ...@@ -2354,13 +2354,13 @@ mysql_execute_command(THD *thd)
if (test_if_data_home_dir(lex->create_info.data_file_name)) if (test_if_data_home_dir(lex->create_info.data_file_name))
{ {
my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECORY"); my_error(ER_WRONG_ARGUMENTS,MYF(0),"DATA DIRECTORY");
res= -1; res= -1;
break; break;
} }
if (test_if_data_home_dir(lex->create_info.index_file_name)) if (test_if_data_home_dir(lex->create_info.index_file_name))
{ {
my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECORY"); my_error(ER_WRONG_ARGUMENTS,MYF(0),"INDEX DIRECTORY");
res= -1; res= -1;
break; break;
} }
......
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