2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
7
DROP PROCEDURE IF EXISTS test.p1;
8
DROP PROCEDURE IF EXISTS test.p2;
9
DROP PROCEDURE IF EXISTS test.p3;
10
grant usage on *.* to user1@localhost;
12
SELECT CURRENT_USER();
18
CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
19
CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
20
CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
21
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
22
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
23
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
25
<******** Master user1 p3 & p2 calls *******>
26
----------------------------------------------
27
SELECT CURRENT_USER();
35
user1@localhost user1@localhost
38
root@localhost user1@localhost
40
<******** Slave user1 p3 & p2 calls *******>
41
---------------------------------------------
42
SELECT CURRENT_USER();
50
user1@localhost user1@localhost
53
root@localhost user1@localhost
54
DROP PROCEDURE IF EXISTS test.p1;
55
DROP PROCEDURE IF EXISTS test.p3;
56
DROP PROCEDURE IF EXISTS test.p2;
57
DROP TABLE IF EXISTS test.t1;
58
DROP TABLE IF EXISTS test.t2;
59
DROP USER user1@localhost;