summaryrefslogtreecommitdiff
path: root/tests/grant.pl
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.com>2000-08-29 19:38:32 +0300
committerunknown <monty@donna.mysql.com>2000-08-29 19:38:32 +0300
commit463016ee2740fa00e56039bc0b1f8122019c982a (patch)
tree11ed770fa863e0b50af0b27d2c231817f7655ef8 /tests/grant.pl
parent3776743da299b4229fe12a36cd6a6c0f6fb6b1e6 (diff)
downloadmariadb-git-463016ee2740fa00e56039bc0b1f8122019c982a.tar.gz
Updates for release
BitKeeper/deleted/.del-mi_debug.c: ***MISSING WEAVE*** BUILD/compile-alpha-ccc: Added thread safe libraries Docs/manual.texi: Added information about --log-slow-queries Makefile.am: Fix for thread safe libraries client/mysql.cc: Allow commands without ; on first line myisam/Makefile.am: Removed mi_debug.c myisam/mi_check.c: Removed compiler warnings myisam/mi_dbug.c: Extra debugging myisammrg/myrg_rkey.c: Removed compiler warnings myisammrg/myrg_rnext.c: Removed compiler warnings myisammrg/myrg_rprev.c: Removed compiler warnings sql/mini_client.cc: Removed compiler warnings sql/mysqld.cc: Updated help sql/sql_parse.cc: Fix permission checking for RENAME tests/grant.pl: Added more grant tests tests/grant.res: New results
Diffstat (limited to 'tests/grant.pl')
-rw-r--r--tests/grant.pl29
1 files changed, 22 insertions, 7 deletions
diff --git a/tests/grant.pl b/tests/grant.pl
index a34a2909897..0219fdb71ee 100644
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -40,9 +40,9 @@ $columns_cols="Host, Db, User, Table_name, Column_name, Column_priv";
# clear grant tables
#
-$dbh = DBI->connect("DBI:mysql:mysql:$opt_host;mysql_read_default_group=perl",
+$dbh = DBI->connect("DBI:mysql:mysql:$opt_host",
$opt_root_user,$opt_password,
- { PrintError => 0}) || die "Can't connect to mysql server: $DBI::errstr\n";
+ { PrintError => 0}) || die "Can't connect to mysql server with user '$opt_root_user': $DBI::errstr\n";
safe_query("delete from user where user='$opt_user' or user='${opt_user}2'");
safe_query("delete from db where user='$opt_user'");
@@ -171,8 +171,7 @@ user_query("create table $opt_database.test2 (a int not null)");
user_query("alter table $opt_database.test2 add b int");
user_query("create index dummy on $opt_database.test2 (a)");
user_query("drop table $opt_database.test2");
-user_query("show tables");
-
+user_query("show tables from grant_test");
# These should fail
user_query("insert into mysql.user (host,user) values ('error','$opt_user',0)",1);
@@ -242,7 +241,22 @@ user_query("grant select on $opt_database.test2 to $user with grant option",1);
safe_query("grant drop on $opt_database.test2 to $user with grant option");
user_query("grant drop on $opt_database.test2 to $user with grant option");
user_query("grant select on $opt_database.test2 to $user with grant option",1);
-user_query("drop table $opt_database.test2");
+
+# check rename privileges
+user_query("rename table $opt_database.test2 to $opt_database.test3",1);
+safe_query("grant CREATE,DROP on $opt_database.test3 to $user");
+user_query("rename table $opt_database.test2 to $opt_database.test3",1);
+user_query("create table $opt_database.test3 (a int)");
+safe_query("grant INSERT on $opt_database.test3 to $user");
+user_query("drop table $opt_database.test3");
+user_query("rename table $opt_database.test2 to $opt_database.test3");
+user_query("rename table $opt_database.test3 to $opt_database.test2",1);
+safe_query("grant ALTER on $opt_database.test3 to $user");
+user_query("rename table $opt_database.test3 to $opt_database.test2");
+safe_query("revoke DROP on $opt_database.test2 from $user");
+user_query("rename table $opt_database.test2 to $opt_database.test3");
+user_query("drop table if exists $opt_database.test2,$opt_database.test3",1);
+safe_query("drop table if exists $opt_database.test2,$opt_database.test3");
# Check that the user doesn't have some user privileges
user_query("create database $opt_database",1);
@@ -253,9 +267,9 @@ safe_query("flush privileges");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
safe_query("revoke ALL PRIVILEGES on $opt_database.test2 from $user");
+safe_query("revoke ALL PRIVILEGES on $opt_database.test3 from $user");
safe_query("revoke GRANT OPTION on $opt_database.test2 from $user");
safe_query("select $tables_cols from mysql.tables_priv");
-
user_query("select count(a) from test",1);
#
@@ -435,7 +449,8 @@ sub print_info
my $tmp;
print <<EOF;
This test will clear your table and column grant table and recreate the
-$opt_database database ! All privileges for $user will be destroyed !
+$opt_database database !
+All privileges for $user will be destroyed !
Don\'t run this test if you have done any GRANT commands that you want to keep!
EOF