summaryrefslogtreecommitdiff
path: root/mysql-test/t/loaddata.test
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2007-02-14 14:51:49 +0100
committerunknown <msvensson@pilot.mysql.com>2007-02-14 14:51:49 +0100
commitfe46b0ff6c862862efa5ad990f4941c03a25640e (patch)
tree8f6f0bf8705654adfef1b27bf5997db33482b106 /mysql-test/t/loaddata.test
parent581db6c18a7a7e566b489509cde5d7d0533f1d3f (diff)
parent555aed64aa38475f424a3620b79a3b5e9d0ddb67 (diff)
downloadmariadb-git-fe46b0ff6c862862efa5ad990f4941c03a25640e.tar.gz
Merge pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
into pilot.mysql.com:/home/msvensson/mysql/mysql-5.1-new-maint mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/loaddata.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/loaddata.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/type_blob.test: Auto merged sql/item_strfunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_load.cc: Auto merged sql/mysqld.cc: Manual merge of OPT_SECUREE_FILE_PRIV sql/set_var.cc: Manual merge sql/share/errmsg.txt: Manual merge, change is already in 5.1 sql/sql_class.h: Manual mergem change is already in 5.1
Diffstat (limited to 'mysql-test/t/loaddata.test')
-rw-r--r--mysql-test/t/loaddata.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index aff5efa51cb..b608ab601c1 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -114,6 +114,29 @@ truncate table t1;
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1 (@dummy,@n) set a= @n, c= (select str from t2 where num=@n);
select * from t1;
+#
+# Bug#18628 mysql-test-run: security problem
+#
+# It should not be possible to load from a file outside of vardir
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+show variables like "secure_file_pri%";
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+select @@secure_file_priv;
+--error 1238
+set @@secure_file_priv= 0;
+
+# Test "load data"
+truncate table t1;
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+--error 1290
+eval load data infile '$MYSQL_TEST_DIR/Makefile' into table t1;
+select * from t1;
+
+# Test "load_file" returns NULL
+--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
+eval select load_file("$MYSQL_TEST_DIR/Makefile");
+
# cleanup
drop table t1, t2;