File: rpl_row_sp012.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (74 lines) | stat: -rw-r--r-- 2,138 bytes parent folder | download | duplicates (6)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#############################################################################
# Original Author: JBM                                                      #
# Original Date: Aug/22/2005                                                #
# Update: 08/29/2005  Added save pos and sync                               #
#############################################################################
#TEST: SP to test security and current_user and user                        #
#############################################################################


# Includes
-- source include/have_binlog_format_row.inc
-- source include/not_embedded.inc
-- source include/master-slave.inc


# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;


# Begin test section 1 
# Create user user1 with no particular access rights
create user user1@localhost;
grant usage on *.* to user1@localhost;
flush privileges;

SELECT CURRENT_USER();
SELECT USER();
CREATE PROCEDURE test.p1 () SQL SECURITY INVOKER SELECT CURRENT_USER(), USER();
CREATE PROCEDURE test.p2 () SQL SECURITY DEFINER CALL test.p1();
CREATE PROCEDURE test.p3 () SQL SECURITY INVOKER CALL test.p1();
GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
set sql_mode=default;

# Need to wait for the rights to be applied at the slave
sync_slave_with_master;

connect (muser1,localhost,user1,,);
connection muser1;
SELECT CURRENT_USER();
SELECT USER();
CALL test.p3();
CALL test.p2();

connect (suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,);

connection master;
save_master_pos;
connection suser1;
sync_with_master;

SELECT CURRENT_USER();
SELECT USER();
CALL test.p3();
CALL test.p2();

# Cleanup
connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP USER user1@localhost;
sync_slave_with_master;

# End of 5.0 test case

--source include/rpl_end.inc