summaryrefslogtreecommitdiff
path: root/tests/grant.pl
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-09 09:14:25 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-09 09:14:25 +0300
commit7845e7f5c0fdc9e5cdec24abd9adcee012546044 (patch)
treee2ebabef0576c3028acbd2ff83536b9e94032e0b /tests/grant.pl
parente6ab3827c47706ba3d9c0f7133ee54aa8fb25db7 (diff)
downloadmariadb-git-7845e7f5c0fdc9e5cdec24abd9adcee012546044.tar.gz
Fixed privilege check problem with SELECT ... INTO OUTFILE
sql/sql_parse.cc: Fixed privilege check problem with SELECT ... INTO OUTFILE tests/grant.pl: Testing of grant problem with SELECT ... INTO OUTFILE tests/grant.res: Testing of grant problem with SELECT ... INTO OUTFILE
Diffstat (limited to 'tests/grant.pl')
-rw-r--r--tests/grant.pl22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/grant.pl b/tests/grant.pl
index 0219fdb71ee..943f2d20186 100644
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -8,9 +8,10 @@ use DBI;
use Getopt::Long;
use strict;
-use vars qw($dbh $user_dbh $opt_help $opt_Information $opt_force $opt_debug
- $opt_verbose $opt_server $opt_root_user $opt_password $opt_user
- $opt_database $opt_host $version $user $tables_cols $columns_cols);
+use vars qw($dbh $user_dbh $opt_help $opt_Information $opt_force $opt_debug
+ $opt_verbose $opt_server $opt_root_user $opt_password $opt_user
+ $opt_database $opt_host $version $user $tables_cols $columns_cols
+ $tmp_table);
$version="1.0";
$opt_help=$opt_Information=$opt_force=$opt_debug=$opt_verbose=0;
@@ -35,6 +36,7 @@ $|=1;
$tables_cols="Host, Db, User, Table_name, Grantor, Table_priv, Column_priv";
$columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
+$tmp_table="/tmp/grant-$$.test";
#
# clear grant tables
@@ -294,6 +296,7 @@ safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke GRANT OPTION on $opt_database.test from $user",1);
+
#
# Test grants on database level
#
@@ -387,11 +390,24 @@ safe_query("grant ALL PRIVILEGES on $opt_database.test to $user identified by 'd
user_connect(0,"dummy");
safe_query("grant SELECT on $opt_database.* to $user identified by ''");
user_connect(0);
+safe_query("revoke SELECT on $opt_database.* from $user identified by ''");
+
+#
+# Test bug reported in SELECT INTO OUTFILE
+#
+
+safe_query("create table $opt_database.test3 (a int)");
+safe_query("grant SELECT on $opt_database.test3 to $user");
+safe_query("grant FILE on *.* to $user");
+safe_query("insert into $opt_database.test3 values (1)");
+user_connect(0);
+user_query("select * into outfile '$tmp_table' from $opt_database.test3");
#
# Clean up things
#
+unlink($tmp_table);
safe_query("drop database $opt_database");
safe_query("delete from user where user='$opt_user'");
safe_query("delete from db where user='$opt_user'");