2000-12-28 02:56:38 +01:00
#
# test of into outfile|dumpfile
#
2004-10-10 11:40:24 +02:00
--disable_warnings
drop table if exists t1;
--enable_warnings
2000-12-28 02:56:38 +01:00
# We need to check that we have 'file' privilege.
#create table t1 (`a` blob);
#insert into t1 values("hello world"),("Hello mars"),(NULL);
#select * into outfile "/tmp/select-test.1" from t1;
#select load_file("/tmp/select-test.1");
#select * into dumpfile "/tmp/select-test.2" from t1 limit 1;
#select load_file("/tmp/select-test.2");
#select * into dumpfile "/tmp/select-test.3" from t1 where a is null;
#select load_file("/tmp/select-test.3");
#
## the following should give errors
#
#select * into outfile "/tmp/select-test.1" from t1;
#select * into dumpfile "/tmp/select-test.1" from t1;
#select * into dumpfile "/tmp/select-test.99" from t1;
#select load_file("/tmp/select-test.not-exist");
#drop table t1;
2002-12-28 20:34:17 +01:00
#drop table if exists t;
2003-12-10 05:31:42 +01:00
#CREATE TABLE t ( t timestamp NOT NULL, c char(200) character set latin1 NOT NULL default '', i int(11), v varchar(200), b blob, KEY t (t)) ENGINE=MyISAM;
2002-12-31 17:01:53 +01:00
#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
#select * from t into outfile "check";
2002-12-28 20:34:17 +01:00
#drop table if exists t;
2004-10-10 11:40:24 +02:00
#
# Bug #5382: 'explain select into outfile' crashes the server
#
CREATE TABLE t1 (a INT);
EXPLAIN
SELECT *
INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
FROM t1;
DROP TABLE t1;