Debian Codegraph @

mysql-test/suite/roles/password.test

raw
1 #
2 # setting authentication for roles
3 #
4
5 --source include/not_embedded.inc
6
7 #identified by [password]...
8 #identified with ... [using ...]
9 #require [subject][issuer][cipher][ssl][x509]
10 # max_queries_per_hour | max_updates_per_hour | max_connections_per_hour | max_user_connections
11 #set password for ... = ...
12
13 set sql_mode='';
14 create role r1;
15
16 # IDENTIFIED does not apply to roles, using it forces username context
17 grant select on *.* to r1 identified by 'foobar';
18 drop user r1;
19 grant select on *.* to r1 identified by '';
20 drop user r1;
21 grant select on mysql.user to r1 identified by password '00000000000000000000000000000000000000000';
22 drop user r1;
23 --error ER_PLUGIN_IS_NOT_LOADED
24 grant select on *.* to r1 identified via plugin;
25 --error ER_PLUGIN_IS_NOT_LOADED
26 grant select on mysql.user to r1 identified via plugin using 'param';
27
28 # same for REQUIRE and mqh
29 grant select on *.* to r1 require subject 'foobar';
30 drop user r1;
31 grant select on mysql.user to r1 require issuer 'foobar';
32 drop user r1;
33 grant select on *.* to r1 require cipher 'foobar';
34 drop user r1;
35 grant select on mysql.user to r1 require ssl;
36 drop user r1;
37 grant select on *.* to r1 require x509;
38 drop user r1;
39 grant select on mysql.user to r1 require none;
40 drop user r1;
41 grant select on *.* to r1 with max_queries_per_hour 10;
42 drop user r1;
43 grant select on mysql.user to r1 with max_updates_per_hour 10;
44 drop user r1;
45 grant select on *.* to r1 with max_connections_per_hour 10;
46 drop user r1;
47 grant select on mysql.user to r1 with max_user_connections 10;
48 drop user r1;
49
50 --error ER_PASSWORD_NO_MATCH
51 set password for r1 = '00000000000000000000000000000000000000000';
52
53 drop role r1;