| 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 |
|
| 8 |
source include/master-slave.inc; |
| 9 |
|
| 10 |
### CLEAN-UP: create an account and manually duplicate it on the slave |
| 11 |
|
| 12 |
connection master; |
| 13 |
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; |
| 14 |
revoke select on *.* from 'user_foo'@'%'; |
| 15 |
select select_priv from mysql.user where user='user_foo' /* master:must be N */; |
| 16 |
|
| 17 |
sync_slave_with_master; |
| 18 |
#connection slave; |
| 19 |
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; |
| 20 |
revoke select on *.* from 'user_foo'@'%'; |
| 21 |
select select_priv from mysql.user where user='user_foo' /* slave:must be N */; |
| 22 |
|
| 23 |
|
| 24 |
### TEST |
| 25 |
|
| 26 |
#connection slave; |
| 27 |
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass'; |
| 28 |
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */; |
| 29 |
|
| 30 |
connection master; |
| 31 |
revoke select on *.* from 'user_foo'; |
| 32 |
select select_priv from mysql.user where user='user_foo' /* master:must be N */; |
| 33 |
|
| 34 |
sync_slave_with_master; |
| 35 |
#connection slave; |
| 36 |
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */; |
| 37 |
|
| 38 |
### CLEAN-UP |
| 39 |
|
| 40 |
connection slave; |
| 41 |
--disable_abort_on_error |
| 42 |
revoke select on *.* FROM 'user_foo'; |
| 43 |
--enable_abort_on_error |
| 44 |
|
| 45 |
connection master; |
| 46 |
delete from mysql.user where user="user_foo"; |
| 47 |
sync_slave_with_master; |
| 48 |
|
| 49 |
# Since changes to mysql.* are ignored, the revoke need to |
| 50 |
# be done on slave as well |
| 51 |
delete from mysql.user where user="user_foo"; |
| 52 |
--source include/rpl_end.inc |