diff options
author | unknown <monty@narttu.mysql.fi> | 2003-06-23 20:03:59 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-06-23 20:03:59 +0300 |
commit | 35c2b9df7564c95c38f04fc4dbc3bebea81a9a41 (patch) | |
tree | 31f9bf5794339dd4559001264cd2cc350877d76b /mysql-test/t/grant.test | |
parent | 16d6c8eb1fc39dd9ae1e396f776b1be270e48d7e (diff) | |
download | mariadb-git-35c2b9df7564c95c38f04fc4dbc3bebea81a9a41.tar.gz |
SHOW GRANTS hided real grants when grants on both column and table (Bug 654)
mysql-test/r/grant.result:
Test of grant BUG
mysql-test/t/grant.test:
Test of grant BUG
sql/sql_acl.cc:
SHOW GRANTS hided real grants when grants on both column and table (Bug 654)
Code cleanup (Bigger than intended because of editor problem)
sql/sql_acl.h:
Fixed grant bug
Diffstat (limited to 'mysql-test/t/grant.test')
-rw-r--r-- | mysql-test/t/grant.test | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index bd04b2e4c41..b18ae941c26 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1,3 +1,7 @@ +--disable_warnings +drop table if exists t1; +--enable_warnings + # # Test that SSL options works properly # @@ -39,6 +43,32 @@ show grants for mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; flush privileges; -grant usage on test.* to user@localhost with grant option; -show grants for user@localhost; +grant usage on test.* to mysqltest_1@localhost with grant option; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; + +# +# Test what happens when you have same table and colum level grants +# +create table t1 (a int); +GRANT select,update,insert on t1 to mysqltest_1@localhost; +GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +REVOKE select (a), update on t1 from mysqltest_1@localhost; +show grants for mysqltest_1@localhost; +REVOKE insert,insert (a) on t1 from mysqltest_1@localhost; +GRANT references on t1 to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; +drop table t1; |