diff options
author | monty@mashka.mysql.fi <> | 2002-06-11 11:20:31 +0300 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2002-06-11 11:20:31 +0300 |
commit | 2aecdd1a91bf8386829146609ce0219c51793841 (patch) | |
tree | 8fcaabe013fff43cf466235067f2c47f0cd66531 /tests/grant.pl | |
parent | db41437a100e204e60f45d5c9a6b26f63e512659 (diff) | |
download | mariadb-git-2aecdd1a91bf8386829146609ce0219c51793841.tar.gz |
Big code cleanup/review before 4.0.2 release.
(All commit emails since 4.0.1 checked)
This had to be done now, before the 4.1 tree changes to much, to make it easy to propagate bug fixes to the 4.1 tree.
Diffstat (limited to 'tests/grant.pl')
-rw-r--r-- | tests/grant.pl | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/tests/grant.pl b/tests/grant.pl index 943f2d20186..4e627737174 100644 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -381,11 +381,15 @@ safe_query("select $tables_cols from mysql.tables_priv where user = '$opt_user'" safe_query("select $columns_cols from mysql.columns_priv where user = '$opt_user'"); # -# Test IDENTIFIED BY -# +# Clear up privileges to make future tests easier safe_query("delete from user where user='$opt_user'"); safe_query("flush privileges"); + +# +# Test IDENTIFIED BY +# + safe_query("grant ALL PRIVILEGES on $opt_database.test to $user identified by 'dummy', ${opt_user}\@127.0.0.1 identified by 'dummy2'"); user_connect(0,"dummy"); safe_query("grant SELECT on $opt_database.* to $user identified by ''"); @@ -402,6 +406,33 @@ 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"); +safe_query("revoke SELECT on $opt_database.test3 from $user"); +safe_query("revoke FILE from *.* from $user"); +safe_query("drop table $opt_database.test3"); + +# +# Test privileges needed for LOCK TABLES +# + +safe_query("create table $opt_database.test3 (a int)"); +user_connect(0); +user_query("select * into outfile '$tmp_table' from $opt_database.test3",1); +safe_query("grant SELECT on $opt_database.test3 to $user"); +user_connect(0); +user_query("LOCK TABLES $opt_database.test3",1); +safe_query("grant INSERT,UPDATE,DELETE on $opt_database.test3 to $user"); +user_connect(0); +user_query("LOCK TABLES $opt_database.test3"); +safe_query("revoke SELECT, INSERT,UPDATE,DELETE on $opt_database.test3 from $user"); +safe_query("grant SELECT,INSERT,UPDATE,DELETE on $opt_database.* to $user"); +user_connect(0); +user_query("LOCK TABLES $opt_database.test3"); +safe_query("revoke SELECT, INSERT,UPDATE,DELETE on $opt_database.* from $user"); +safe_query("grant SELECT,INSERT,UPDATE,DELETE on *.* to $user"); +user_connect(0); +user_query("LOCK TABLES $opt_database.test3"); +user_query("UNLOCK TABLES"); +safe_query("revoke SELECT, INSERT,UPDATE,DELETE on *.* from $user"); # # Clean up things |