~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/outfile.test

  • Committer: Monty Taylor
  • Date: 2008-08-02 00:06:32 UTC
  • mto: (236.1.42 codestyle)
  • mto: This revision was merged to the branch mainline in revision 261.
  • Revision ID: monty@inaugust.com-20080802000632-jsse0zdd9r6ic5ku
Actually turn gettext on...

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
disable_query_log;
2
 
# Server are started in "var/master-data/local", so "../../tmp" will be "var/tmp"
3
 
eval set @tmpdir="../../tmp";
4
 
enable_query_log;
5
 
 
6
 
#
7
 
# test of into outfile|dumpfile
8
 
#
9
 
 
10
 
--disable_warnings
11
 
drop table if exists t1;
12
 
--enable_warnings
13
 
 
14
 
create table t1 (`a` blob);
15
 
insert into t1 values("hello world"),("Hello mars"),(NULL);
16
 
disable_query_log;
17
 
eval select * into outfile "../../tmp/outfile-test.1" from t1;
18
 
enable_query_log;
19
 
select load_file(concat(@tmpdir,"/outfile-test.1"));
20
 
disable_query_log;
21
 
eval select * into dumpfile "../../tmp/outfile-test.2" from t1 limit 1;
22
 
enable_query_log;
23
 
select load_file(concat(@tmpdir,"/outfile-test.2"));
24
 
disable_query_log;
25
 
eval select * into dumpfile "../../tmp/outfile-test.3" from t1 where a is null;
26
 
enable_query_log;
27
 
select load_file(concat(@tmpdir,"/outfile-test.3"));
28
 
 
29
 
# the following should give errors
30
 
 
31
 
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;
40
 
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
45
 
drop table t1;
46
 
 
47
 
# Bug#8191
48
 
disable_query_log;
49
 
eval select 1 into outfile "../../tmp/outfile-test.4";
50
 
enable_query_log;
51
 
select load_file(concat(@tmpdir,"/outfile-test.4"));
52
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
53
 
 
54
 
#
55
 
# Bug #5382: 'explain select into outfile' crashes the server
56
 
#
57
 
 
58
 
CREATE TABLE t1 (a INT);
59
 
EXPLAIN 
60
 
  SELECT *
61
 
  INTO OUTFILE '../../tmp/t1.txt'
62
 
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
63
 
  FROM t1;
64
 
DROP TABLE t1;
65
 
 
66
 
# End of 4.1 tests
67
 
 
68
 
#
69
 
# Bug#13202  SELECT * INTO OUTFILE ... FROM data_dictionary.schemas now fails
70
 
#
71
 
disable_query_log;
72
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.4"
73
 
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
74
 
FROM data_dictionary.schemas LIMIT 0, 5;
75
 
# enable_query_log;
76
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
77
 
 
78
 
use data_dictionary;
79
 
# disable_query_log;
80
 
eval SELECT * INTO OUTFILE "../../tmp/outfile-test.5"
81
 
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
82
 
FROM schemas LIMIT 0, 5;
83
 
enable_query_log;
84
 
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.5
85
 
use test;
86
 
 
87
 
#
88
 
# Bug#18628 mysql-test-run: security problem
89
 
#
90
 
# It should not be possible to write to a file outside of vardir
91
 
create table t1(a int);
92
 
--replace_result $DRIZZLE_TEST_DIR DRIZZLE_TEST_DIR
93
 
--error ER_OPTION_PREVENTS_STATEMENT
94
 
eval select * into outfile "$DRIZZLE_TEST_DIR/outfile-test1" from t1;
95
 
drop table t1;