mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-6720 - enable connection log in mysqltest by default
This commit is contained in:
@ -66,6 +66,7 @@ load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
|
||||
|
||||
Section 3.1.6 - Privilege Checks:
|
||||
--------------------------------------------------------------------------------
|
||||
connection default;
|
||||
USE db_storedproc_1;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
@ -80,6 +81,7 @@ grant all on db_storedproc_1.* to 'user_1'@'localhost';
|
||||
revoke create routine on db_storedproc_1.* from 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
connect user1a, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
USE db_storedproc_1;
|
||||
@ -88,10 +90,13 @@ BEGIN
|
||||
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
|
||||
END//
|
||||
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
|
||||
disconnect user1a;
|
||||
connection default;
|
||||
USE db_storedproc_1;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
|
||||
connect user1b, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
USE db_storedproc_1;
|
||||
@ -99,6 +104,8 @@ CREATE PROCEDURE sp1(v1 char(20))
|
||||
BEGIN
|
||||
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
|
||||
END//
|
||||
disconnect user1b;
|
||||
connection default;
|
||||
USE db_storedproc_1;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
@ -114,6 +121,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
|
||||
DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
|
||||
connect user2, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
CREATE PROCEDURE sp3(v1 char(20))
|
||||
@ -124,6 +132,8 @@ CREATE FUNCTION fn1(v1 int) returns int
|
||||
BEGIN
|
||||
return v1;
|
||||
END//
|
||||
disconnect user2;
|
||||
connection default;
|
||||
USE db_storedproc_1;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
@ -146,6 +156,7 @@ CREATE PROCEDURE sp4(v1 char(20))
|
||||
BEGIN
|
||||
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
|
||||
END//
|
||||
connect user3, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
USE db_storedproc_1;
|
||||
@ -167,6 +178,8 @@ SQL_DATA_ACCESS CONTAINS SQL
|
||||
SECURITY_TYPE DEFINER
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
disconnect user3;
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
DROP PROCEDURE sp4;
|
||||
@ -187,6 +200,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
|
||||
grant SELECT on db_storedproc_1.* to 'user_2'@'localhost';
|
||||
grant execute on db_storedproc_1.* to 'user_2'@'localhost';
|
||||
flush privileges;
|
||||
connect user5_1, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
CREATE PROCEDURE sp5_s_i () sql security definer
|
||||
@ -202,6 +216,8 @@ CREATE PROCEDURE sp5_ins () sql security definer
|
||||
BEGIN
|
||||
insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_ins', 1000);
|
||||
END//
|
||||
disconnect user5_1;
|
||||
connect user5_2, localhost, user_2, , db_storedproc_1;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp5_s_i();
|
||||
@ -210,12 +226,14 @@ CALL sp5_ins();
|
||||
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
CALL sp5_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
CALL sp5_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
grant insert on db_storedproc_1.* to 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
connection user5_2;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp5_s_i();
|
||||
@ -223,12 +241,14 @@ ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165
|
||||
CALL sp5_ins();
|
||||
CALL sp5_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
CALL sp5_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
connection user5_2;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp5_s_i();
|
||||
@ -242,10 +262,12 @@ inserted outside of SP NULL
|
||||
inserted from sp5_ins 2000-10-00
|
||||
inserted from sp5_s_i 2000-10-00
|
||||
inserted from sp5_ins 2000-10-00
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
REVOKE INSERT on db_storedproc_1.* from 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
connection user5_2;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp5_s_i();
|
||||
@ -263,10 +285,12 @@ inserted outside of SP NULL
|
||||
inserted from sp5_ins 2000-10-00
|
||||
inserted from sp5_s_i 2000-10-00
|
||||
inserted from sp5_ins 2000-10-00
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
REVOKE SELECT on db_storedproc_1.* from 'user_1'@'localhost';
|
||||
flush privileges;
|
||||
connection user5_2;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp5_s_i();
|
||||
@ -275,6 +299,8 @@ CALL sp5_ins();
|
||||
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
CALL sp5_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
|
||||
disconnect user5_2;
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
DROP PROCEDURE sp5_s_i;
|
||||
@ -299,6 +325,7 @@ GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
|
||||
GRANT SELECT ON db_storedproc_1.* TO 'user_2'@'localhost';
|
||||
GRANT EXECUTE ON db_storedproc_1.* TO 'user_2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
connect user6_1, localhost, user_1, , db_storedproc_1;
|
||||
|
||||
user_1@localhost db_storedproc_1
|
||||
CREATE PROCEDURE sp3166_s_i () SQL SECURITY INVOKER
|
||||
@ -314,6 +341,8 @@ CREATE PROCEDURE sp3166_ins () SQL SECURITY INVOKER
|
||||
BEGIN
|
||||
insert into db_storedproc_1.t3166 values ('inserted from sp3166_ins');
|
||||
END//
|
||||
disconnect user6_1;
|
||||
connect user6_2, localhost, user_2, , db_storedproc_1;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp3166_s_i();
|
||||
@ -325,6 +354,7 @@ ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166
|
||||
CALL sp3166_sel();
|
||||
c1
|
||||
inserted outside SP
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
CALL sp3166_sel();
|
||||
@ -332,6 +362,8 @@ c1
|
||||
inserted outside SP
|
||||
GRANT INSERT ON db_storedproc_1.* TO 'user_2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
disconnect user6_2;
|
||||
connect user6_3, localhost, user_2, , db_storedproc_1;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp3166_s_i();
|
||||
@ -343,6 +375,8 @@ c1
|
||||
inserted outside SP
|
||||
inserted from sp3166_s_i
|
||||
inserted from sp3166_ins
|
||||
disconnect user6_3;
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
CALL sp3166_sel();
|
||||
@ -352,6 +386,7 @@ inserted from sp3166_s_i
|
||||
inserted from sp3166_ins
|
||||
REVOKE SELECT ON db_storedproc_1.* FROM 'user_2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
connect user6_4, localhost, user_2, , db_storedproc_1;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp3166_s_i();
|
||||
@ -359,6 +394,8 @@ ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166
|
||||
CALL sp3166_ins();
|
||||
CALL sp3166_sel();
|
||||
ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
|
||||
disconnect user6_4;
|
||||
connection default;
|
||||
CALL sp3166_s_i();
|
||||
c1
|
||||
inserted outside SP
|
||||
@ -369,6 +406,7 @@ inserted from sp3166_ins
|
||||
root@localhost db_storedproc_1
|
||||
REVOKE EXECUTE on db_storedproc_1.* FROM 'user_2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
connect user6_5, localhost, user_2, , db_storedproc_1;
|
||||
|
||||
user_2@localhost db_storedproc_1
|
||||
CALL sp3166_s_i();
|
||||
@ -377,6 +415,8 @@ CALL sp3166_ins();
|
||||
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_ins'
|
||||
CALL sp3166_sel();
|
||||
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_sel'
|
||||
disconnect user6_5;
|
||||
connection default;
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
DROP PROCEDURE sp3166_s_i;
|
||||
|
Reference in New Issue
Block a user