~skinny.moey/drizzle/innodb-replication

« back to all changes in this revision

Viewing changes to tests/t/outfile.test

  • Committer: Brian Aker
  • Date: 2010-11-08 22:35:57 UTC
  • mfrom: (1802.1.114 trunk)
  • Revision ID: brian@tangent.org-20101108223557-w3xzwp9hjjtjhtc1
MergeĀ inĀ trunk.

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;
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
 
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
--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
45
64
drop table t1;
46
65
 
47
66
# Bug#8191
48
67
disable_query_log;
49
 
eval select 1 into outfile "../../tmp/outfile-test.4";
 
68
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
69
eval select 1 into outfile "$DRIZZLETEST_VARDIR/tmp/outfile-test.4";
50
70
enable_query_log;
 
71
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
51
72
select load_file(concat(@tmpdir,"/outfile-test.4"));
52
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
 
73
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
53
74
 
54
75
#
55
76
# Bug #5382: 'explain select into outfile' crashes the server
56
77
#
57
78
 
58
79
CREATE TABLE t1 (a INT);
59
 
EXPLAIN 
60
 
  SELECT *
61
 
  INTO OUTFILE '../../tmp/t1.txt'
 
80
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
81
eval EXPLAIN SELECT * INTO OUTFILE '$DRIZZLETEST_VARDIR/tmp/t1.txt' 
62
82
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
63
83
  FROM t1;
64
84
DROP TABLE t1;
69
89
# Bug#13202  SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
70
90
#
71
91
disable_query_log;
72
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
 
92
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
93
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.4"
73
94
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
74
95
FROM data_dictionary.schemas LIMIT 0, 5;
75
96
# enable_query_log;
76
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
 
97
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.4
77
98
 
78
99
use data_dictionary;
79
100
# disable_query_log;
80
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
 
101
--replace_result $DRIZZLETEST_VARDIR DRIZZLETEST_VARDIR
 
102
eval SELECT * INTO OUTFILE "$DRIZZLETEST_VARDIR/tmp/outfile-test.5"
81
103
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
82
104
FROM schemas LIMIT 0, 5;
83
105
enable_query_log;
84
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.5
 
106
--remove_file $DRIZZLETEST_VARDIR/tmp/outfile-test.5
85
107
use test;
86
108
 
87
109
#