blob: ee7d17f3a1fc56c1d7593726f3e0a8855d22a746 (
plain)
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
75
76
77
78
79
80
81
|
create user foo;
create role role1;
create role role2;
create role role3;
grant role1 to foo;
grant role2 to role1;
grant role3 to foo;
connect foo, localhost, foo;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@% role1 NO NO
foo@% role3 NO NO
role1 role2 NO NULL
set default role role3;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@% role1 NO NO
foo@% role3 NO YES
role1 role2 NO NULL
set default role role1;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@% role1 NO YES
foo@% role3 NO NO
role1 role2 NO NULL
disconnect foo;
connection default;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES NO
root@localhost role2 YES NO
root@localhost role3 YES NO
set default role none for foo;
connect foo, localhost, foo;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
foo@% role1 NO NO
foo@% role3 NO NO
role1 role2 NO NULL
disconnect foo;
connection default;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES NO
root@localhost role2 YES NO
root@localhost role3 YES NO
set default role role1;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES YES
root@localhost role2 YES NO
root@localhost role3 YES NO
set default role role2;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES NO
root@localhost role2 YES YES
root@localhost role3 YES NO
set default role role3;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES NO
root@localhost role2 YES NO
root@localhost role3 YES YES
set default role none;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
role1 role2 NO NULL
root@localhost role1 YES NO
root@localhost role2 YES NO
root@localhost role3 YES NO
drop role role3;
drop role role2;
drop role role1;
drop user foo;
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.default_role'));
|