Debian Codegraph @

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

raw
1 -- source include/have_innodb.inc
2 -- source include/not_embedded.inc
3 -- source include/have_binlog_format_mixed_or_statement.inc
4 source include/master-slave.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 let $wait_binlog_event= grant select;
22 source include/wait_for_binlog_event.inc;
23 #
24 # There is no active transaction here
25 #
26 rollback;
27 show grants for x@y;
28 start transaction;
29 insert into t values (2);
30 revoke select on t from x@y;
31 let $wait_binlog_event= revoke select;
32 source include/wait_for_binlog_event.inc;
33 #
34 # There is no active transaction here
35 #
36 commit;
37 select * from t;
38 show grants for x@y;
39 drop user x@y;
40 drop database d1;
41
42 --source include/rpl_end.inc