14
14
create table t1 (`a` blob);
15
15
insert into t1 values("hello world"),("Hello mars"),(NULL);
17
eval select * into outfile "../../tmp/outfile-test.1" from t1;
17
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
18
eval select * into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.1" from t1;
19
20
select load_file(concat(@tmpdir,"/outfile-test.1"));
21
eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
22
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
23
eval select * into dumpfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.2" from t1 limit 1;
23
25
select load_file(concat(@tmpdir,"/outfile-test.2"));
25
eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
27
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
28
eval select * into dumpfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.3" from t1 where a is null;
27
30
select load_file(concat(@tmpdir,"/outfile-test.3"));
29
32
# the following should give errors
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;
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;
41
47
--error ER_TEXTFILE_NOT_READABLE
42
48
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
50
eval select 1 into outfile "../../tmp/outfile-test.4";
56
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
57
eval select 1 into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.4";
52
59
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
53
60
select load_file(concat(@tmpdir,"/outfile-test.4"));
60
67
CREATE TABLE t1 (a INT);
63
INTO OUTFILE '../../tmp/t1.txt'
68
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
69
eval EXPLAIN SELECT * INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/t1.txt'
64
70
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
71
77
# Bug#13202 SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
74
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
80
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
81
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.4"
75
82
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
76
83
FROM data_dictionary.schemas LIMIT 0, 5;
77
84
# enable_query_log;
80
87
use data_dictionary;
81
88
# disable_query_log;
82
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
89
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
90
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.5"
83
91
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
84
92
FROM schemas LIMIT 0, 5;