symlink.result 6.11 KB
Newer Older
1
drop table if exists t1,t2,t7,t8,t9;
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
2
drop database if exists mysqltest;
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a));
create table t2 (a int not null auto_increment, b char(16) not null, primary key (a));
insert into t1 (b) values ("test"),("test1"),("test2"),("test3");
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
insert into t2 (b) select b from t1;
insert into t1 (b) select b from t2;
drop table t2;
25
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";
26 27
insert into t9 select * from t1;
check table t9;
28 29
Table	Op	Msg_type	Msg_text
test.t9	check	status	OK
30
optimize table t9;
31 32
Table	Op	Msg_type	Msg_text
test.t9	optimize	status	OK
33
repair table t9;
34 35
Table	Op	Msg_type	Msg_text
test.t9	repair	status	OK
36 37
alter table t9 add column c int not null;
show create table t9;
38 39
Table	Create Table
t9	CREATE TABLE `t9` (
40
  `a` int(11) NOT NULL AUTO_INCREMENT,
41 42
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
43
  PRIMARY KEY (`a`)
44
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
45 46 47 48
alter table t9 rename t8, add column d int not null;
alter table t8 rename t7;
rename table t7 to t9;
drop table t1;
49 50 51
SHOW CREATE TABLE t9;
Table	Create Table
t9	CREATE TABLE `t9` (
52
  `a` int(11) NOT NULL AUTO_INCREMENT,
53 54 55
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) NOT NULL,
56
  PRIMARY KEY (`a`)
57
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
58 59
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";
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
60
Got one of the listed errors
61
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";
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
62
Got one of the listed errors
63
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";
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
64
Got one of the listed errors
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
65 66
alter table t9 rename mysqltest.t9;
select count(*) from mysqltest.t9;
67 68
count(*)
16724
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
69
show create table mysqltest.t9;
70 71
Table	Create Table
t9	CREATE TABLE `t9` (
72
  `a` int(11) NOT NULL AUTO_INCREMENT,
73 74 75
  `b` char(16) NOT NULL,
  `c` int(11) NOT NULL,
  `d` int(11) NOT NULL,
76
  PRIMARY KEY (`a`)
77
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
monty@narttu.mysql.fi's avatar
monty@narttu.mysql.fi committed
78
drop database mysqltest;
79
create table t1 (a int not null) engine=myisam;
80
alter table t1 data directory="MYSQLTEST_VARDIR/tmp";
81 82
Warnings:
Warning	0	DATA DIRECTORY option ignored
83 84 85
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
86
  `a` int(11) NOT NULL
monty@mysql.com's avatar
monty@mysql.com committed
87
) ENGINE=MyISAM DEFAULT CHARSET=latin1
88
alter table t1 add b int;
89
alter table t1 data directory="MYSQLTEST_VARDIR/log";
90 91
Warnings:
Warning	0	DATA DIRECTORY option ignored
92 93 94
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
95
  `a` int(11) NOT NULL,
96
  `b` int(11) DEFAULT NULL
monty@mysql.com's avatar
monty@mysql.com committed
97
) ENGINE=MyISAM DEFAULT CHARSET=latin1
98
alter table t1 index directory="MYSQLTEST_VARDIR/log";
99 100
Warnings:
Warning	0	INDEX DIRECTORY option ignored
101 102 103
show create table t1;
Table	Create Table
t1	CREATE TABLE `t1` (
104
  `a` int(11) NOT NULL,
105
  `b` int(11) DEFAULT NULL
monty@mysql.com's avatar
monty@mysql.com committed
106
) ENGINE=MyISAM DEFAULT CHARSET=latin1
107
drop table t1;
108
CREATE TABLE t1(a INT)
109 110
DATA DIRECTORY='TEST_DIR/tmp'
INDEX DIRECTORY='TEST_DIR/tmp';
111
Got one of the listed errors
112 113 114 115 116 117
CREATE TABLE t2(a INT)
DATA DIRECTORY='TEST_DIR/tmp'
INDEX DIRECTORY='TEST_DIR/tmp';
RENAME TABLE t2 TO t1;
ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17)
DROP TABLE t2;
118
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 9 a;
119 120 121
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
122
  `a` int(11) DEFAULT NULL
123
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
124
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 99 a;
125 126 127
show create table t1;
Table	Create Table
t1	CREATE TEMPORARY TABLE `t1` (
128
  `a` int(11) DEFAULT NULL
129
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
130 131 132 133 134 135 136 137 138 139 140
create table t1 (a int) engine=myisam select 42 a;
select * from t1;
a
9
select * from t1;
a
99
select * from t1;
a
42
drop table t1;
141
End of 4.1 tests
142 143
SET SESSION keep_files_on_create = TRUE;
CREATE TABLE t1 (a INT) ENGINE MYISAM;
144
Got one of the listed errors
145 146 147
SET SESSION keep_files_on_create = FALSE;
CREATE TABLE t1 (a INT) ENGINE MYISAM;
DROP TABLE t1;
148
End of 5.0 tests
149 150
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data/mysql';
istruewing@stella.local's avatar
istruewing@stella.local committed
151
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
152 153
CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/test';
istruewing@stella.local's avatar
istruewing@stella.local committed
154
ERROR HY000: Incorrect arguments to DATA DIRECTORY
155 156
CREATE TABLE t1(a INT)
DATA DIRECTORY='TEST_DIR/master-data/';
istruewing@stella.local's avatar
istruewing@stella.local committed
157
ERROR HY000: Incorrect arguments to DATA DIRECTORY
158 159
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data';
istruewing@stella.local's avatar
istruewing@stella.local committed
160
ERROR HY000: Incorrect arguments to INDEX DIRECTORY
161 162 163
CREATE TABLE t1(a INT)
INDEX DIRECTORY='TEST_DIR/master-data_var';
ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errcode: 2)
164 165 166 167 168 169 170 171
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp';
Warnings:
Warning	0	DATA DIRECTORY option ignored
Warning	0	INDEX DIRECTORY option ignored
DROP TABLE t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
End of 5.1 tests