14
14
create table t1 (`a` blob);
15
15
insert into t1 values("hello world"),("Hello mars"),(NULL);
17
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
18
eval select * into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.1" from t1;
17
eval select * into outfile "../../tmp/outfile-test.1" from t1;
20
19
select load_file(concat(@tmpdir,"/outfile-test.1"));
22
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
23
eval select * into dumpfile "$DRIZZLETEST_VARDIR/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
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
28
eval select * into dumpfile "$DRIZZLETEST_VARDIR/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;
30
27
select load_file(concat(@tmpdir,"/outfile-test.3"));
32
29
# the following should give errors
35
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
36
--error ER_FILE_EXISTS_ERROR
37
eval select * into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.1" from t1;
39
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
40
--error ER_FILE_EXISTS_ERROR
41
eval select * into dumpfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.2" from t1;
43
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
44
--error ER_FILE_EXISTS_ERROR
45
eval select * into dumpfile "$DRIZZLETEST_VARDIR/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;
48
# The test below drastically shortens $DRIZZLETEST_VARDIR
49
# to just VAR and uses a less informative file name
50
# This is done to accomodate longer file paths
51
# We were seeing error message truncation when
52
# the path to the server under test was long (110+ chars)
55
let $bad_test_file ="$DRIZZLETEST_VARDIR/tmp/bad";
57
let $replace_substring = `SELECT SUBSTRING($bad_test_file,1,128)`;
58
--replace_result $replace_substring DRIZZLETEST_BAD_FILE $bad_test_file DRIZZLETEST_BAD_FILE
59
--error ER_TEXTFILE_NOT_READABLE
60
eval select load_file($bad_test_file);
61
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.1
62
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.2
63
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.3
41
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
42
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.1
43
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.2
44
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
68
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
69
eval select 1 into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.4";
49
eval select 1 into outfile "../../tmp/outfile-test.4";
71
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
72
51
select load_file(concat(@tmpdir,"/outfile-test.4"));
73
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
52
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
76
55
# Bug #5382: 'explain select into outfile' crashes the server
79
58
CREATE TABLE t1 (a INT);
80
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
81
eval EXPLAIN SELECT * INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/t1.txt'
61
INTO OUTFILE '../../tmp/t1.txt'
82
62
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
89
69
# Bug#13202 SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
92
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
93
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.4"
72
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
94
73
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
95
74
FROM data_dictionary.schemas LIMIT 0, 5;
96
75
# enable_query_log;
97
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
76
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
99
78
use data_dictionary;
100
79
# disable_query_log;
101
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
102
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.5"
80
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
103
81
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
104
82
FROM schemas LIMIT 0, 5;
106
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.5
84
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.5