| 1 |
# test verifies that REVOKE must not be replicated when |
| 2 |
# slave server starts with --replicate-wild-ignore-table=mysql.% |
| 3 |
# the option is set in rpl_ignore_revoke-slave.opt |
| 4 |
# The first part of BUG#9483 for GRANT is checked by |
| 5 |
# existed specific rpl_ignore_grant test case (BUG#980) |
| 6 |
|
| 7 |
--source include/not_group_replication_plugin.inc |
| 8 |
source include/set_privilege_checks_user_as_system_user.inc; |
| 9 |
let $rpl_privilege_checks_user_grant_option = 1; |
| 10 |
source include/master-slave.inc; |
| 11 |
|
| 12 |
### CLEAN-UP: create an account and manually duplicate it on the slave |
| 13 |
|
| 14 |
connection master; |
| 15 |
create user 'user_foo'@'%' identified by 'user_foopass'; |
| 16 |
grant select on *.* to 'user_foo'@'%'; |
| 17 |
revoke select on *.* from 'user_foo'@'%'; |
| 18 |
select select_priv from mysql.user where user='user_foo' /* master:must be N */; |
| 19 |
|
| 20 |
--source include/sync_slave_sql_with_master.inc |
| 21 |
#connection slave; |
| 22 |
create user 'user_foo'@'%' identified by 'user_foopass'; |
| 23 |
grant select on *.* to 'user_foo'@'%'; |
| 24 |
revoke select on *.* from 'user_foo'@'%'; |
| 25 |
select select_priv from mysql.user where user='user_foo' /* slave:must be N */; |
| 26 |
|
| 27 |
|
| 28 |
### TEST |
| 29 |
|
| 30 |
#connection slave; |
| 31 |
grant select on *.* to 'user_foo'@'%'; |
| 32 |
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */; |
| 33 |
|
| 34 |
connection master; |
| 35 |
revoke select on *.* from 'user_foo'; |
| 36 |
select select_priv from mysql.user where user='user_foo' /* master:must be N */; |
| 37 |
|
| 38 |
--source include/sync_slave_sql_with_master.inc |
| 39 |
#connection slave; |
| 40 |
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; |
| 41 |
|
| 42 |
### CLEAN-UP |
| 43 |
|
| 44 |
connection slave; |
| 45 |
--disable_abort_on_error |
| 46 |
revoke select on *.* FROM 'user_foo'; |
| 47 |
--enable_abort_on_error |
| 48 |
|
| 49 |
connection master; |
| 50 |
delete from mysql.user where user="user_foo"; |
| 51 |
--source include/sync_slave_sql_with_master.inc |
| 52 |
|
| 53 |
# Since changes to mysql.* are ignored, the revoke need to |
| 54 |
# be done on slave as well |
| 55 |
delete from mysql.user where user="user_foo"; |
| 56 |
--source include/rpl_end.inc |