~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/symlink.test

  • Committer: Brian Aker
  • Date: 2009-07-12 00:49:18 UTC
  • mfrom: (1063.9.51 brian-tmp-fix)
  • Revision ID: brian@gaz-20090712004918-chprmyj387ex6l8a
Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
40
40
 
41
41
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
42
 
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";
 
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";
43
43
 
44
44
insert into t9 select * from t1;
45
45
check table t9;
54
54
# Test renames
55
55
alter table t9 rename t8, add column d int not null;
56
56
alter table t8 rename t7;
57
 
rename table t7 to t9;
 
57
# because "rename table t7 to t9" should obviously not support temp tables. GAH
 
58
alter table t7 rename t9;
58
59
# Drop old t1 table, keep t9
59
60
drop table t1;
60
61
 
74
75
create database mysqltest;
75
76
 
76
77
--error 1,1
77
 
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";
 
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";
78
79
 
79
80
--error 1103,1103
80
 
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";
81
 
 
82
 
# Should fail becasue the file t9.MYI already exist in 'run'
83
 
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
84
 
--error 1,1,1105
85
 
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";
86
 
 
87
 
# Should fail becasue the file t9.MYD already exist in 'tmp'
88
 
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
89
 
--error 1,1,ER_TABLE_EXISTS_ERROR
90
 
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";
 
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";
91
82
 
92
83
# Check moving table t9 from default database to mysqltest;
93
84
# In this case the symlinks should be removed.
102
93
# Test changing data dir (Bug #1662)
103
94
#
104
95
 
105
 
create table t1 (a int not null) engine=myisam;
 
96
create temporary table t1 (a int not null) engine=myisam;
106
97
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
107
98
eval alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
108
99
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
118
109
drop table t1;
119
110
 
120
111
#
121
 
# BUG#32111 - Security Breach via DATA/INDEX DIRECTORY and RENAME TABLE
122
 
#
123
 
--write_file $MYSQLTEST_VARDIR/tmp/t1.MYI
124
 
EOF
125
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR $MYSQLTEST_VARDIR TEST_DIR
126
 
--error 1,1
127
 
eval CREATE TABLE t1(a INT)
128
 
DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp'
129
 
INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp' ENGINE=MyISAM;
130
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
131
 
eval CREATE TABLE t2(a INT)
132
 
DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp'
133
 
INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp' ENGINE=MyISAM;
134
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
135
 
--error 1
136
 
RENAME TABLE t2 TO t1;
137
 
DROP TABLE t2;
138
 
--remove_file $MYSQLTEST_VARDIR/tmp/t1.MYI
139
 
 
140
 
#
141
112
# Bug#8706 - temporary table with data directory option fails
142
113
#
143
114
connect (session1,localhost,root,,);
160
131
show create table t1;
161
132
 
162
133
connection default;
163
 
create table t1 (a int) engine=myisam select 42 a;
164
 
 
165
 
connection session1;
166
 
select * from t1;
167
 
disconnect session1;
168
 
connection session2;
169
 
select * from t1;
170
 
disconnect session2;
171
 
connection default;
172
 
select * from t1;
173
 
drop table t1;
174
134
 
175
135
--echo End of 4.1 tests
176
136
 
177
137
--echo End of 5.0 tests
178
138
 
179
 
#
180
 
# Bug#32167: another privilege bypass with DATA/INDEX DIRECTORY
181
 
#
182
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
183
 
--error 1210
184
 
eval CREATE TABLE t1(a INT)
185
 
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data/mysql';
186
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
187
 
--error 1210
188
 
eval CREATE TABLE t1(a INT)
189
 
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/test';
190
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
191
 
--error 1210
192
 
eval CREATE TABLE t1(a INT)
193
 
DATA DIRECTORY='$MYSQLTEST_VARDIR/master-data/';
194
 
--replace_result $MYSQLTEST_VARDIR TEST_DIR
195
 
--error 1210
196
 
eval CREATE TABLE t1(a INT)
197
 
INDEX DIRECTORY='$MYSQLTEST_VARDIR/master-data';
198
 
 
199
139
--replace_result $MYSQLTEST_VARDIR TEST_DIR
200
140
# Bug 311013 - specifying not existent directory does not give an error
201
141
#--error 1