Debian Codegraph @

mysql-test/suite/group_replication/t/gr_write_concurrency_privilege.test

raw
1 ###############################################################################
2 # WL#11512
3 # The user must have GROUP_REPLICATION_ADMIN privileges to modify the group's
4 # "write concurrency."
5 #
6 # Test:
7 # 0. One server is enough for this test
8 # 1. Create user without GROUP_REPLICATION_ADMIN privileges
9 # 2. Connect to server using under-privileged user
10 # 3. Modifying the group's "write concurrency" should fail due to lack of
11 # privileges
12 # 4. Cleanup
13 #
14 ###############################################################################
15
16 --source include/not_have_privilege_checks_user.inc
17 --source include/have_group_replication_plugin.inc
18 --let $rpl_skip_group_replication_start= 1
19 --source include/group_replication.inc
20 --source include/start_and_bootstrap_group_replication.inc
21
22 --echo
23 --echo # 1. Create user without GROUP_REPLICATION_ADMIN privileges
24
25 CREATE USER 'group_rpl_user' IDENTIFIED BY '';
26 --connect (con_group_rpl_user,127.0.0.1,group_rpl_user,,test,$MASTER_MYPORT,,)
27
28 --echo
29 --echo # 2. Connect to server using group_rpl_user
30
31 --let $rpl_connection_name= con_group_rpl_user
32 --source include/rpl_connection.inc
33
34 --echo
35 --echo # 3. group_replication_set_write_concurrency should fail due to lack of privileges
36
37 --error ER_CANT_INITIALIZE_UDF
38 SELECT group_replication_set_write_concurrency(42);
39
40 SELECT group_replication_get_write_concurrency();
41
42 --echo
43 --echo # 4. Cleanup
44
45 --let $rpl_connection_name= default
46 --source include/rpl_connection.inc
47
48 --disconnect con_group_rpl_user
49 DROP USER group_rpl_user;
50
51 --source include/group_replication_end.inc