diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/grant.pl | 10 | ||||
-rw-r--r-- | tests/grant.res | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/tests/grant.pl b/tests/grant.pl index ba95d78d068..5a24127d79d 100644 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -210,6 +210,16 @@ user_query("delete from $opt_database.test where a=1",1); user_query("update $opt_database.test set b=3 where b=1",1); user_query("update $opt_database.test set b=b+1",1); +# +# Test global SELECT privilege combined with table level privileges +# + +safe_query("grant SELECT on *.* to $user"); +user_connect(0); +user_query("update $opt_database.test set b=b+1"); +safe_query("revoke SELECT on *.* from $user"); +user_connect(0); + # Add one privilege at a time until the user has all privileges user_query("select * from test",1); safe_query("grant select on $opt_database.test to $user"); diff --git a/tests/grant.res b/tests/grant.res index 822e9320f53..92d271cd864 100644 --- a/tests/grant.res +++ b/tests/grant.res @@ -195,7 +195,12 @@ update grant_test.test set b=3 where b=1 Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test' update grant_test.test set b=b+1 Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test' -select * from test +grant SELECT on *.* to grant_user@localhost +Connecting grant_user +update grant_test.test set b=b+1 +revoke SELECT on *.* from grant_user@localhost +Connecting grant_user +lect * from test Error in execute: select command denied to user: 'grant_user@localhost' for table 'test' grant select on grant_test.test to grant_user@localhost delete from grant_test.test where a=1 |