~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/outfile.test

  • Committer: Brian Aker
  • Date: 2010-10-29 01:13:40 UTC
  • mto: (1890.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1891.
  • Revision ID: brian@tangent.org-20101029011340-y9ixm180v9daypqr
Remove warnings for c++

Show diffs side-by-side

added added

removed removed

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