~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/outfile.test

  • Committer: Brian Aker
  • Date: 2010-10-20 20:26:18 UTC
  • mfrom: (1859.2.13 refactor)
  • Revision ID: brian@tangent.org-20101020202618-9222n39lm329urv5
Merge for Brian 

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="$DRIZZLETEST_VARDIR/tmp";
 
3
eval set @tmpdir="../../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
 
--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;
19
18
enable_query_log;
20
19
select load_file(concat(@tmpdir,"/outfile-test.1"));
21
20
disable_query_log;
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;
24
22
enable_query_log;
25
23
select load_file(concat(@tmpdir,"/outfile-test.2"));
26
24
disable_query_log;
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;
29
26
enable_query_log;
30
27
select load_file(concat(@tmpdir,"/outfile-test.3"));
31
28
 
32
29
# the following should give errors
33
30
 
34
31
disable_query_log;
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;
 
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;
46
40
enable_query_log;
47
 
 
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)
53
 
 
54
 
--disable_query_log
55
 
let $bad_test_file ="$DRIZZLETEST_VARDIR/tmp/bad";
56
 
--enable_query_log
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
41
--error ER_TEXTFILE_NOT_READABLE
60
 
eval select load_file($bad_test_file);
 
42
select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
61
43
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.1
62
44
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.2
63
45
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.3
65
47
 
66
48
# Bug#8191
67
49
disable_query_log;
68
 
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
69
 
eval select 1 into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.4";
 
50
eval select 1 into outfile "../../tmp/outfile-test.4";
70
51
enable_query_log;
71
52
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
72
53
select load_file(concat(@tmpdir,"/outfile-test.4"));
77
58
#
78
59
 
79
60
CREATE TABLE t1 (a INT);
80
 
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
81
 
eval EXPLAIN SELECT * INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/t1.txt' 
 
61
EXPLAIN 
 
62
  SELECT *
 
63
  INTO OUTFILE '../../tmp/t1.txt'
82
64
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
83
65
  FROM t1;
84
66
DROP TABLE t1;
89
71
# Bug#13202  SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
90
72
#
91
73
disable_query_log;
92
 
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
93
 
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.4"
 
74
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
94
75
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
95
76
FROM data_dictionary.schemas LIMIT 0, 5;
96
77
# enable_query_log;
98
79
 
99
80
use data_dictionary;
100
81
# disable_query_log;
101
 
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
102
 
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.5"
 
82
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
103
83
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
104
84
FROM schemas LIMIT 0, 5;
105
85
enable_query_log;