1
#############################################################################
2
# Original Author: JBM #
3
# Original Date: Aug/22/2005 #
4
# Update: 08/29/2005 Added save pos and sync #
5
#############################################################################
6
#TEST: SP to test security and current_user and user #
7
#############################################################################
11
-- source include/have_binlog_format_row.inc
12
-- source include/not_embedded.inc
13
-- source include/master-slave.inc
16
# Begin clean up test section
19
DROP PROCEDURE IF EXISTS test.p1;
20
DROP PROCEDURE IF EXISTS test.p2;
21
DROP PROCEDURE IF EXISTS test.p3;
24
# Begin test section 1
25
# Create user user1 with no particular access rights
26
grant usage on *.* to user1@localhost;
29
SELECT CURRENT_USER();
31
CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
32
CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
33
CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
34
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
35
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
36
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
38
# Need to wait for the rights to be applied at the slave
39
sync_slave_with_master;
41
let $message=<******** Master user1 p3 & p2 calls *******>;
42
--source include/show_msg.inc
43
connect (muser1,localhost,user1,,);
45
SELECT CURRENT_USER();
50
let $message=<******** Slave user1 p3 & p2 calls *******>;
51
--source include/show_msg.inc
52
connect (suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,);
59
SELECT CURRENT_USER();
66
DROP PROCEDURE IF EXISTS test.p1;
67
DROP PROCEDURE IF EXISTS test.p3;
68
DROP PROCEDURE IF EXISTS test.p2;
69
DROP TABLE IF EXISTS test.t1;
70
DROP TABLE IF EXISTS test.t2;
71
DROP USER user1@localhost;
72
sync_slave_with_master;
74
# End of 5.0 test case