~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/outfile.test

  • Committer: patrick crews
  • Date: 2010-10-26 01:31:08 UTC
  • mfrom: (1878.7.1 drizzle)
  • mto: (1902.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1903.
  • Revision ID: gleebix@gmail.com-20101026013108-t2c3nokk4k8a7sxk
Updated tests to use variable vardir rather than a hard-coded one

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
disable_query_log;
2
2
# Server are started in "var/master-data/local", so "../../tmp" will be "var/tmp"
3
 
eval set @tmpdir="../../tmp";
 
3
eval set @tmpdir="$DRIZZLETEST_VARDIR/tmp";
4
4
enable_query_log;
5
5
 
6
6
#
14
14
create table t1 (`a` blob);
15
15
insert into t1 values("hello world"),("Hello mars"),(NULL);
16
16
disable_query_log;
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;
18
19
enable_query_log;
19
20
select load_file(concat(@tmpdir,"/outfile-test.1"));
20
21
disable_query_log;
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;
22
24
enable_query_log;
23
25
select load_file(concat(@tmpdir,"/outfile-test.2"));
24
26
disable_query_log;
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;
26
29
enable_query_log;
27
30
select load_file(concat(@tmpdir,"/outfile-test.3"));
28
31
 
29
32
# the following should give errors
30
33
 
31
34
disable_query_log;
32
 
--error ER_FILE_EXISTS_ERROR
33
 
eval select * into outfile "../../tmp/outfile-test.1" from t1;
34
 
 
35
 
--error ER_FILE_EXISTS_ERROR
36
 
eval select * into dumpfile "../../tmp/outfile-test.2" from t1;
37
 
 
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;
 
38
 
 
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;
 
42
 
 
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;
40
46
enable_query_log;
 
47
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
41
48
--error ER_TEXTFILE_NOT_READABLE
42
49
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
43
50
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.1
47
54
 
48
55
# Bug#8191
49
56
disable_query_log;
50
 
eval select 1 into outfile "../../tmp/outfile-test.4";
 
57
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
58
eval select 1 into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.4";
51
59
enable_query_log;
52
60
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
53
61
select load_file(concat(@tmpdir,"/outfile-test.4"));
58
66
#
59
67
 
60
68
CREATE TABLE t1 (a INT);
61
 
EXPLAIN 
62
 
  SELECT *
63
 
  INTO OUTFILE '../../tmp/t1.txt'
 
69
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
70
eval EXPLAIN SELECT * INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/t1.txt' 
64
71
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
65
72
  FROM t1;
66
73
DROP TABLE t1;
71
78
# Bug#13202  SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
72
79
#
73
80
disable_query_log;
74
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
 
81
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
82
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.4"
75
83
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
76
84
FROM data_dictionary.schemas LIMIT 0, 5;
77
85
# enable_query_log;
79
87
 
80
88
use data_dictionary;
81
89
# disable_query_log;
82
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
 
90
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
91
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.5"
83
92
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
84
93
FROM schemas LIMIT 0, 5;
85
94
enable_query_log;