summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/roles/rpl_definer.test
blob: 8e19bd16705ccb2509f6224de547367b91aea8d0 (plain)
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
#
# replication of the DEFINER=current_role
#

--source include/master-slave.inc

create role role1;
create role role2;
grant execute on test.* to role2;
grant role2 to role1;
set role role1;
--sorted_result
show grants;

create definer=current_user procedure pcu() select current_user;
create definer=root@localhost procedure pu() select "root@localhost";
create definer=current_role procedure pcr() select current_role;
create definer=role1 procedure pr() select "role1";

show create procedure pcu;
show create procedure pu;
show create procedure pcr;
show create procedure pr;

sync_slave_with_master;

set role role1;
--sorted_result
show grants;

show create procedure pcu;
show create procedure pu;
show create procedure pcr;
show create procedure pr;

connection master;

drop procedure pcu;
drop procedure pu;
drop procedure pcr;
drop procedure pr;
drop role role1;
drop role role2;

--source include/rpl_end.inc