summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/outfile.result10
-rw-r--r--mysql-test/t/outfile.test16
2 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
new file mode 100644
index 00000000000..4dc09f65b7c
--- /dev/null
+++ b/mysql-test/r/outfile.result
@@ -0,0 +1,10 @@
+drop table if exists t1;
+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;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+DROP TABLE t1;
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index a7b81d565e6..28d5ebfaf99 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -2,6 +2,10 @@
# test of into outfile|dumpfile
#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
# We need to check that we have 'file' privilege.
#drop table if exists t1;
@@ -26,3 +30,15 @@
#INSERT INTO t VALUES ('2002-12-20 12:01:20','',1,"aaa","bbb");
#select * from t into outfile "check";
#drop table if exists t;
+
+#
+# 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;