Debian Codegraph @

mysql-test/suite/rpl/t/rpl_binlog_grant.test

raw
1 --source include/set_privilege_checks_user_as_system_user.inc
2 --let $rpl_privilege_checks_user_grant_option= 1
3 source include/master-slave.inc;
4 -- source include/have_binlog_format_mixed_or_statement.inc
5
6 let $VERSION=`select version()`;
7
8 # Bug #21975: grant/revoke statements in transaction
9 # used to disappear from binlog upon rallback.
10 # Now GRANT/REVOKE do implicitly commit
11 # transaction
12
13 create database d1;
14 use d1;
15 create table t (s1 int) engine=innodb;
16 set @@autocommit=0;
17 start transaction;
18 insert into t values (1);
19 create user x@y;
20 grant select on t to x@y;
21
22 let $wait_binlog_event= grant select;
23 source include/wait_for_binlog_event.inc;
24 #
25 # There is no active transaction here
26 #
27 rollback;
28 show grants for x@y;
29 start transaction;
30 insert into t values (2);
31 revoke select on t from x@y;
32 let $wait_binlog_event= revoke select;
33 source include/wait_for_binlog_event.inc;
34 #
35 # There is no active transaction here
36 #
37 commit;
38 select * from t;
39 show grants for x@y;
40 drop user x@y;
41 drop database d1;
42
43 --source include/rpl_end.inc