Debian Codegraph @

mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result

raw
1 ** Setup **
2 SET @global_automatic_sp_privileges = @@GLOBAL.automatic_sp_privileges;
3 CREATE TABLE t1 (a varchar(200));
4 INSERT INTO t1 VALUES('Procedure Executed.');
5 CREATE USER 'userTest'@'localhost';
6 GRANT CREATE ROUTINE, SELECT ON test.* to 'userTest'@'localhost';
7 CREATE USER 'userTest1'@'localhost';
8 GRANT CREATE ROUTINE, SELECT ON test.* to 'userTest1'@'localhost';
9 connection default;
10 SET GLOBAL automatic_sp_privileges = TRUE;
11 connect conUser,localhost,userTest,,;
12 connection conUser;
13 CREATE PROCEDURE testProc ()
14 BEGIN
15 SELECT * FROM t1;
16 END;|
17 CALL testProc();
18 a
19 Procedure Executed.
20 Expecting SELECT executed
21 connection default;
22 SET GLOBAL automatic_sp_privileges = FALSE;
23 connect conUser1,localhost,userTest1,,;
24 connection conUser1;
25 CREATE PROCEDURE testProc1 ()
26 BEGIN
27 SELECT * FROM t1;
28 END;|
29
30 Expected error access denied
31 CALL testProc1();
32 ERROR 42000: execute command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
33
34 Expected error access denied
35 ALTER PROCEDURE testProc1 COMMENT 'My Comment';
36 ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
37
38 Expected error access denied
39 DROP PROCEDURE testProc1;
40 ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
41 connection default;
42 GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost';
43 connection conUser1;
44 CALL testProc1();
45 a
46 Procedure Executed.
47 Expecting seelect executed
48 ALTER PROCEDURE testProc1 COMMENT 'My Comment';
49
50 ** Cleanup **
51 connection default;
52 disconnect conUser;
53 disconnect conUser1;
54 SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges;
55 REVOKE EXECUTE, ALTER ROUTINE ON PROCEDURE testProc FROM 'userTest'@'localhost';
56 REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest'@'localhost';
57 REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest1'@'localhost';
58 DROP PROCEDURE testProc;
59 DROP PROCEDURE testProc1;
60 DROP USER 'userTest'@'localhost';
61 DROP USER 'userTest1'@'localhost';
62 DROP TABLE t1;