diff options
author | unknown <antony@ltantony.mysql.com> | 2005-05-08 22:56:58 +0100 |
---|---|---|
committer | unknown <antony@ltantony.mysql.com> | 2005-05-08 22:56:58 +0100 |
commit | 3ac2df4e4c2366d4b30b3251590207a3d07f483d (patch) | |
tree | 10cc2644866c76b24f2a1d676cdec9c02762c378 /mysql-test/t/outfile.test | |
parent | ede028b0638239f61812e3a0f226ca7adf451ed7 (diff) | |
download | mariadb-git-3ac2df4e4c2366d4b30b3251590207a3d07f483d.tar.gz |
Bug#8191 - SELECT INTO OUTFILE insists on FROM clause
Fix bug + include test case.
Enable outfile tests.
mysql-test/t/outfile.test:
Reenable outfile tests
Add test for Bug#8191
sql/sql_yacc.yy:
Fix Bug#8191
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'mysql-test/t/outfile.test')
-rw-r--r-- | mysql-test/t/outfile.test | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test index c126d221bd2..f86c4163289 100644 --- a/mysql-test/t/outfile.test +++ b/mysql-test/t/outfile.test @@ -1,23 +1,47 @@ +disable_query_log; +-- source include/test_outfile.inc +eval set @tmpdir="$MYSQL_TEST_DIR/var/tmp"; +enable_query_log; +-- source include/have_outfile.inc # # test of into outfile|dumpfile # -# We need to check that we have 'file' privilege. +drop table if exists t1; +create table t1 (`a` blob); +insert into t1 values("hello world"),("Hello mars"),(NULL); +disable_query_log; +eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1; +enable_query_log; +select load_file(concat(@tmpdir,"/outfile-test.1")); +disable_query_log; +eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1 limit 1; +enable_query_log; +select load_file(concat(@tmpdir,"/outfile-test.2")); +disable_query_log; +eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1 where a is null; +enable_query_log; +select load_file(concat(@tmpdir,"/outfile-test.3")); -#drop table if exists t1; -#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; +# the following should give errors + +disable_query_log; +--error 1086 +eval select * into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.1" from t1; +--error 1086 +eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.2" from t1; +--error 1086 +eval select * into dumpfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.3" from t1; +enable_query_log; +select load_file(concat(@tmpdir,"/outfile-test.not-exist")); +--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.1 +--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.2 +--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.3 +drop table t1; + +# Bug#8191 +disable_query_log; +eval select 1 into outfile "$MYSQL_TEST_DIR/var/tmp/outfile-test.4"; +enable_query_log; +select load_file(concat(@tmpdir,"/outfile-test.4")); +--exec rm $MYSQL_TEST_DIR/var/tmp/outfile-test.4 |