1
--source include/have_symlink.inc
2
#--source include/not_windows.inc
5
drop table if exists t1,t2,t7,t8,t9;
6
drop database if exists mysqltest;
10
# First create little data to play with
13
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a));
14
create table t2 (a int not null auto_increment, b char(16) not null, primary key (a));
15
insert into t1 (b) values ("test"),("test1"),("test2"),("test3");
16
insert into t2 (b) select b from t1;
17
insert into t1 (b) select b from t2;
18
insert into t2 (b) select b from t1;
19
insert into t1 (b) select b from t2;
20
insert into t2 (b) select b from t1;
21
insert into t1 (b) select b from t2;
22
insert into t2 (b) select b from t1;
23
insert into t1 (b) select b from t2;
24
insert into t2 (b) select b from t1;
25
insert into t1 (b) select b from t2;
26
insert into t2 (b) select b from t1;
27
insert into t1 (b) select b from t2;
28
insert into t2 (b) select b from t1;
29
insert into t1 (b) select b from t2;
30
insert into t2 (b) select b from t1;
31
insert into t1 (b) select b from t2;
32
insert into t2 (b) select b from t1;
33
insert into t1 (b) select b from t2;
38
# We use t9 here to not crash with tables generated by the backup test
41
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
42
eval create temporary 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";
44
insert into t9 select * from t1;
47
SET GLOBAL myisam_sort_buffer_size=1024;
49
alter table t9 add column c int not null;
51
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
55
alter table t9 rename t8, add column d int not null;
56
alter table t8 rename t7;
57
# because "rename table t7 to t9" should obviously not support temp tables. GAH
58
alter table t7 rename t9;
59
# Drop old t1 table, keep t9
64
# Note that we are using the above table t9 here!
67
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
71
create table t1 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam data directory="tmp";
73
# Check that we cannot link over a table from another database.
75
create database mysqltest;
78
create temporary 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";
81
create temporary table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="not-hard-path";
83
# Check moving table t9 from default database to mysqltest;
84
# In this case the symlinks should be removed.
86
alter table t9 rename mysqltest.t9;
87
select count(*) from mysqltest.t9;
88
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
89
show create table mysqltest.t9;
90
drop database mysqltest;
93
# Test changing data dir (Bug #1662)
96
create temporary table t1 (a int not null) engine=myisam;
97
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
98
eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
99
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
100
show create table t1;
101
alter table t1 add b int;
102
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
103
eval alter table t1 data directory="$MYSQLTEST_VARDIR/log";
104
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
105
show create table t1;
106
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
107
eval alter table t1 index directory="$MYSQLTEST_VARDIR/log";
108
show create table t1;
112
# Bug#8706 - temporary table with data directory option fails
114
connect (session1,localhost,root,,);
115
connect (session2,localhost,root,,);
118
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
119
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 9 a;
120
# If running test suite with a non standard tmp dir, the "show create table"
121
# will print "DATA_DIRECTORY=". Use replace_result to mask it out
122
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
123
show create table t1;
126
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
127
eval create temporary table t1 (a int) engine=myisam data directory="$MYSQLTEST_VARDIR/log" select 99 a;
128
# If running test suite with a non standard tmp dir, the "show create table"
129
# will print "DATA_DIRECTORY=". Use replace_result to mask it out
130
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
131
show create table t1;
135
--echo End of 4.1 tests
137
--echo End of 5.0 tests
140
# Bug 311013 - specifying non existent directory does not give an error
141
# We use the ARCHIVE engine instead of MyISAM here for testing the data
142
# directory option since the file names output by MyISAM are always
143
# different so the output would be non-deterministic
146
eval CREATE TABLE t1(a INT) engine=archive
147
DATA DIRECTORY='/foo/bar/far';
149
# BUG#25677 - With --skip-symbolic-links option on, DATA DIRECTORY clause is
151
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
153
eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp';
155
--echo End of 5.1 tests
156
SET GLOBAL myisam_sort_buffer_size=DEFAULT;