File: rpl_ignore_revoke.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (56 lines) | stat: -rw-r--r-- 1,907 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# test verifies that REVOKE must not be replicated when
# slave server starts with --replicate-wild-ignore-table=mysql.%
# the option is set in rpl_ignore_revoke-slave.opt
# The first part of BUG#9483 for GRANT is checked by
# existed specific rpl_ignore_grant test case (BUG#980)

--source include/not_group_replication_plugin.inc
source include/set_privilege_checks_user_as_system_user.inc;
let $rpl_privilege_checks_user_grant_option = 1;
source include/master-slave.inc;

###  CLEAN-UP: create an account and manually duplicate it on the slave

connection master;
create user 'user_foo'@'%' identified by 'user_foopass';
grant select on *.* to 'user_foo'@'%';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;

--source include/sync_slave_sql_with_master.inc
#connection slave;
create user 'user_foo'@'%' identified by 'user_foopass';
grant select on *.* to 'user_foo'@'%';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* slave:must be N */;


### TEST

#connection slave;
grant select on *.* to 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */;

connection master;
revoke select on *.* from 'user_foo';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;

--source include/sync_slave_sql_with_master.inc
#connection slave;
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */;

### CLEAN-UP

connection slave;
--disable_abort_on_error
revoke select on *.* FROM 'user_foo';
--enable_abort_on_error

connection master;
delete from mysql.user where user="user_foo";
--source include/sync_slave_sql_with_master.inc

# Since changes to mysql.* are ignored, the revoke need to
# be done on slave as well
delete from mysql.user where user="user_foo";
--source include/rpl_end.inc