~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_row_sp012.test

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#############################################################################
 
8
 
 
9
 
 
10
# Includes
 
11
-- source include/have_binlog_format_row.inc
 
12
-- source include/not_embedded.inc
 
13
-- source include/master-slave.inc
 
14
 
 
15
 
 
16
# Begin clean up test section
 
17
connection master;
 
18
--disable_warnings
 
19
DROP PROCEDURE IF EXISTS test.p1;
 
20
DROP PROCEDURE IF EXISTS test.p2;
 
21
DROP PROCEDURE IF EXISTS test.p3;
 
22
 
 
23
 
 
24
# Begin test section 1 
 
25
# Create user user1 with no particular access rights
 
26
grant usage on *.* to user1@localhost;
 
27
flush privileges;
 
28
 
 
29
SELECT CURRENT_USER();
 
30
SELECT 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;
 
37
 
 
38
# Need to wait for the rights to be applied at the slave
 
39
sync_slave_with_master;
 
40
 
 
41
let $message=<********  Master user1 p3 & p2 calls *******>;
 
42
--source include/show_msg.inc
 
43
connect (muser1,localhost,user1,,);
 
44
connection muser1;
 
45
SELECT CURRENT_USER();
 
46
SELECT USER();
 
47
CALL test.p3();
 
48
CALL test.p2();
 
49
 
 
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,);
 
53
 
 
54
connection master;
 
55
save_master_pos;
 
56
connection suser1;
 
57
sync_with_master;
 
58
 
 
59
SELECT CURRENT_USER();
 
60
SELECT USER();
 
61
CALL test.p3();
 
62
CALL test.p2();
 
63
 
 
64
# Cleanup
 
65
connection master;
 
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;
 
73
 
 
74
# End of 5.0 test case
 
75