2
# Server are started in "var/master-data", so "../tmp" will be "var/tmp"
3
eval set @tmpdir="../tmp";
2
# Server are started in "var/master-data/local", so "../../tmp" will be "var/tmp"
3
eval set @tmpdir="../../tmp";
7
7
# test of into outfile|dumpfile
16
14
create table t1 (`a` blob);
17
15
insert into t1 values("hello world"),("Hello mars"),(NULL);
19
eval select * into outfile "../tmp/outfile-test.1" from t1;
17
eval select * into outfile "../../tmp/outfile-test.1" from t1;
21
19
select load_file(concat(@tmpdir,"/outfile-test.1"));
23
eval select * into dumpfile "../tmp/outfile-test.2" from t1 limit 1;
21
eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
25
23
select load_file(concat(@tmpdir,"/outfile-test.2"));
27
eval select * into dumpfile "../tmp/outfile-test.3" from t1 where a is null;
25
eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
29
27
select load_file(concat(@tmpdir,"/outfile-test.3"));
31
29
# the following should give errors
35
eval select * into outfile "../tmp/outfile-test.1" from t1;
38
eval select * into dumpfile "../tmp/outfile-test.2" from t1;
41
eval select * into dumpfile "../tmp/outfile-test.3" from t1;
32
--error ER_FILE_EXISTS_ERROR
33
eval select * into outfile "../../tmp/outfile-test.1" from t1;
35
--error ER_FILE_EXISTS_ERROR
36
eval select * into dumpfile "../../tmp/outfile-test.2" from t1;
38
--error ER_FILE_EXISTS_ERROR
39
eval select * into dumpfile "../../tmp/outfile-test.3" from t1;
41
--error ER_TEXTFILE_NOT_READABLE
43
42
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
44
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
45
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2
46
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
43
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.1
44
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.2
45
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.3
51
eval select 1 into outfile "../tmp/outfile-test.4";
50
eval select 1 into outfile "../../tmp/outfile-test.4";
52
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
53
53
select load_file(concat(@tmpdir,"/outfile-test.4"));
54
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
54
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
57
57
# Bug #5382: 'explain select into outfile' crashes the server
71
71
# Bug#13202 SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
74
eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
74
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
75
75
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
76
76
FROM data_dictionary.schemas LIMIT 0, 5;
77
77
# enable_query_log;
78
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
78
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
80
80
use data_dictionary;
81
81
# disable_query_log;
82
eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
82
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
83
83
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
84
84
FROM schemas LIMIT 0, 5;
86
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
86
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.5