summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-12-02 13:34:30 +0400
committerunknown <ram@gw.mysql.r18.ru>2004-12-02 13:34:30 +0400
commit491a3d90a99c3849c220592b4f8ff29de8484de9 (patch)
treec596bb93ad8484a3ee8304221ae337a4af3061c8 /mysql-test
parent6f20687e202303fe61a4e827fe74a5133e57337a (diff)
downloadmariadb-git-491a3d90a99c3849c220592b4f8ff29de8484de9.tar.gz
Fixes (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv
bug #6933: error in the tests/grant.pl test). mysql-test/r/grant.result: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). mysql-test/t/grant.test: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). sql/sql_acl.cc: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). The problem is that we use whole key length (including 'Column_name' keypart) during scanning the 'columns_priv' table in case of revoke_grant. tests/grant.pl: A fix (bug #6933: error in the tests/grant.pl test).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/grant.result20
-rw-r--r--mysql-test/t/grant.test13
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index f903e35fa1f..d163e1033fc 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -321,3 +321,23 @@ DROP DATABASE testdb7;
DROP DATABASE testdb8;
DROP DATABASE testdb9;
DROP DATABASE testdb10;
+create table t1(a int, b int, c int, d int);
+grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
+show grants for grant_user@localhost;
+Grants for grant_user@localhost
+GRANT USAGE ON *.* TO 'grant_user'@'localhost'
+GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost'
+select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
+Host Db User Table_name Column_name Column_priv
+localhost test grant_user t1 c Insert
+localhost test grant_user t1 b Insert
+localhost test grant_user t1 a Insert
+localhost test grant_user t1 d Insert
+revoke ALL PRIVILEGES on t1 from grant_user@localhost;
+show grants for grant_user@localhost;
+Grants for grant_user@localhost
+GRANT USAGE ON *.* TO 'grant_user'@'localhost'
+select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
+Host Db User Table_name Column_name Column_priv
+drop user grant_user@localhost;
+drop table t1;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 963b9ae5080..169dd03ad86 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -267,3 +267,16 @@ DROP DATABASE testdb8;
DROP DATABASE testdb9;
DROP DATABASE testdb10;
+#
+# Bug #6932: a problem with 'revoke ALL PRIVILEGES'
+#
+
+create table t1(a int, b int, c int, d int);
+grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost;
+show grants for grant_user@localhost;
+select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
+revoke ALL PRIVILEGES on t1 from grant_user@localhost;
+show grants for grant_user@localhost;
+select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv;
+drop user grant_user@localhost;
+drop table t1;