Debian Codegraph @

mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test

raw
1 --source include/not_embedded.inc
2
3 --echo #
4 --echo # MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
5 --echo #
6
7 #
8 # Binlog is not opened in this test.
9 # So the test returns "access denied" on the lack of privileges,
10 # or "Binlog closed, cannot RESET MASTER" on success.
11 #
12
13 --let var = gtid_binlog_state
14 --let grant = REPLICATION MASTER ADMIN
15 --let value = '0-1-10'
16
17 --echo # Test that "SET $var" is not allowed without $grant
18
19 CREATE USER user1@localhost;
20 GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
21 --eval REVOKE $grant ON *.* FROM user1@localhost
22 --connect(user1,localhost,user1,,)
23 --connection user1
24 --error ER_SPECIFIC_ACCESS_DENIED_ERROR
25 --eval SET GLOBAL $var=$value
26 --error ER_GLOBAL_VARIABLE
27 --eval SET $var=$value
28 --error ER_GLOBAL_VARIABLE
29 --eval SET SESSION $var=$value
30 --disconnect user1
31 --connection default
32 DROP USER user1@localhost;
33
34 --echo # Test that "SET $var" is allowed with $grant
35
36 CREATE USER user1@localhost;
37 --eval GRANT $grant ON *.* TO user1@localhost
38 --connect(user1,localhost,user1,,)
39 --connection user1
40 --error ER_FLUSH_MASTER_BINLOG_CLOSED
41 --eval SET GLOBAL $var=$value
42 --error ER_GLOBAL_VARIABLE
43 --eval SET $var=$value
44 --error ER_GLOBAL_VARIABLE
45 --eval SET SESSION $var=$value
46 --disconnect user1
47 --connection default
48 DROP USER user1@localhost;