Debian Codegraph @

mysql-test/suite/rpl_nogtid/r/rpl_grant.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
5 [connection master]
6 **** On Master ****
7 CREATE USER dummy@localhost;
8 CREATE USER dummy1@localhost, dummy2@localhost;
9 SELECT user, host FROM mysql.user WHERE user like 'dummy%';
10 user host
11 dummy localhost
12 dummy1 localhost
13 dummy2 localhost
14 SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
15 COUNT(*)
16 3
17 include/sync_slave_sql_with_master.inc
18 **** On Slave ****
19 SELECT user,host FROM mysql.user WHERE user like 'dummy%';
20 user host
21 dummy localhost
22 dummy1 localhost
23 dummy2 localhost
24 SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
25 COUNT(*)
26 3
27 **** On Master ****
28 DROP USER nonexisting@localhost;
29 ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
30 DROP USER nonexisting@localhost, dummy@localhost;
31 ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
32 DROP USER dummy@localhost, dummy1@localhost, dummy2@localhost;
33 SELECT user, host FROM mysql.user WHERE user like 'dummy%';
34 user host
35 SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
36 COUNT(*)
37 0
38 include/sync_slave_sql_with_master.inc
39 **** On Slave ****
40 SELECT user,host FROM mysql.user WHERE user like 'dummy%';
41 user host
42 SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
43 COUNT(*)
44 0
45 ##########
46 ########## setup (PART I)
47 ##########
48 include/rpl_reset.inc
49 CREATE DATABASE b54866 ;
50 use b54866;
51 CREATE TABLE t1 ( c1 INT, c2 INT, c3 INT );
52 ##########
53 ########## GRANT ALL
54 ##########
55 CREATE USER 'b54866_user'@'localhost';
56 GRANT ALL ON b54866.* TO 'b54866_user'@'localhost';
57 REVOKE ALL ON b54866.* FROM 'b54866_user'@'localhost', 'b54866_fake_user';
58 ERROR 42000: There is no such grant defined for user 'b54866_fake_user' on host '%'
59 ****** Checking grants on the master for user: b54866_user ******
60 SHOW GRANTS FOR 'b54866_user'@'localhost';
61 Grants for b54866_user@localhost
62 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
63 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
64 *************************************************************
65 include/sync_slave_sql_with_master.inc
66 ****** Checking grants on the master for user: b54866_user ******
67 SHOW GRANTS FOR 'b54866_user'@'localhost';
68 Grants for b54866_user@localhost
69 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
70 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
71 *************************************************************
72 include/sync_slave_sql_with_master.inc
73 ****** Checking grants on the slave for user: b54866_user *******
74 SHOW GRANTS FOR 'b54866_user'@'localhost';
75 Grants for b54866_user@localhost
76 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
77 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
78 *************************************************************
79 ##########
80 ########## TABLE GRANTS
81 ##########
82 GRANT ALTER,CREATE,DROP ON TABLE b54866.t1 TO 'b54866_user'@'localhost';
83 ****** Checking grants on the master for user: b54866_user ******
84 SHOW GRANTS FOR 'b54866_user'@'localhost';
85 Grants for b54866_user@localhost
86 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
87 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
88 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
89 *************************************************************
90 include/sync_slave_sql_with_master.inc
91 ****** Checking grants on the slave for user: b54866_user *******
92 SHOW GRANTS FOR 'b54866_user'@'localhost';
93 Grants for b54866_user@localhost
94 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
95 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
96 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
97 *************************************************************
98 REVOKE ALTER ON TABLE b54866.t1 FROM 'b54866_user'@'localhost', 'b54866_fake_user';
99 ERROR 42000: There is no such grant defined for user 'b54866_fake_user' on host '%' on table 't1'
100 ****** Checking grants on the master for user: b54866_user ******
101 SHOW GRANTS FOR 'b54866_user'@'localhost';
102 Grants for b54866_user@localhost
103 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
104 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
105 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
106 *************************************************************
107 include/sync_slave_sql_with_master.inc
108 ****** Checking grants on the slave for user: b54866_user *******
109 SHOW GRANTS FOR 'b54866_user'@'localhost';
110 Grants for b54866_user@localhost
111 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
112 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
113 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
114 *************************************************************
115 ##########
116 ########## setup (PART II)
117 ##########
118 CREATE PROCEDURE b54866_p() BEGIN SELECT 1; END|
119 CREATE FUNCTION b54866_f() RETURNS INT BEGIN RETURN 1; END|
120 GRANT EXECUTE ON PROCEDURE b54866.b54866_p TO 'b54866_user'@'localhost';
121 GRANT EXECUTE ON FUNCTION b54866.b54866_f TO 'b54866_user'@'localhost';
122 ****** Checking grants on the master for user: b54866_user ******
123 SHOW GRANTS FOR 'b54866_user'@'localhost';
124 Grants for b54866_user@localhost
125 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
126 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
127 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
128 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
129 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
130 *************************************************************
131 include/sync_slave_sql_with_master.inc
132 ****** Checking grants on the slave for user: b54866_user *******
133 SHOW GRANTS FOR 'b54866_user'@'localhost';
134 Grants for b54866_user@localhost
135 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
136 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
137 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
138 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
139 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
140 *************************************************************
141 ##########
142 ########## PROCEDURE
143 ##########
144 #### PROCEDURE ASSERTION
145 REVOKE EXECUTE ON PROCEDURE b54866.b54866_p FROM 'b54866_user'@'localhost', 'b54866_fake_user';
146 ERROR 42000: There is no such grant defined for user 'b54866_fake_user' on host '%' on routine 'b54866_p'
147 ****** Checking grants on the master for user: b54866_user ******
148 SHOW GRANTS FOR 'b54866_user'@'localhost';
149 Grants for b54866_user@localhost
150 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
151 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
152 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
153 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
154 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
155 *************************************************************
156 include/sync_slave_sql_with_master.inc
157 ****** Checking grants on the slave for user: b54866_user *******
158 SHOW GRANTS FOR 'b54866_user'@'localhost';
159 Grants for b54866_user@localhost
160 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
161 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
162 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
163 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
164 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
165 *************************************************************
166 ##########
167 ########## FUNCTION
168 ##########
169 REVOKE EXECUTE ON FUNCTION b54866.b54866_f FROM 'b54866_user'@'localhost', 'b54866_fake_user';
170 ERROR 42000: There is no such grant defined for user 'b54866_fake_user' on host '%' on routine 'b54866_f'
171 ****** Checking grants on the master for user: b54866_user ******
172 SHOW GRANTS FOR 'b54866_user'@'localhost';
173 Grants for b54866_user@localhost
174 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
175 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
176 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
177 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
178 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
179 *************************************************************
180 include/sync_slave_sql_with_master.inc
181 ****** Checking grants on the slave for user: b54866_user *******
182 SHOW GRANTS FOR 'b54866_user'@'localhost';
183 Grants for b54866_user@localhost
184 GRANT USAGE ON *.* TO `b54866_user`@`localhost`
185 GRANT ALL PRIVILEGES ON `b54866`.* TO `b54866_user`@`localhost`
186 GRANT CREATE, DROP, ALTER ON `b54866`.`t1` TO `b54866_user`@`localhost`
187 GRANT EXECUTE ON PROCEDURE `b54866`.`b54866_p` TO `b54866_user`@`localhost`
188 GRANT EXECUTE ON FUNCTION `b54866`.`b54866_f` TO `b54866_user`@`localhost`
189 *************************************************************
190 ##########
191 ########## empty revokes should not be binlogged
192 ##########
193 REVOKE EXECUTE ON PROCEDURE b54866_p FROM 'fake_user'@'localhost';
194 ERROR 42000: There is no such grant defined for user 'fake_user' on host 'localhost' on routine 'b54866_p'
195 REVOKE EXECUTE ON FUNCTION b54866_f FROM 'fake_user'@'localhost';
196 ERROR 42000: There is no such grant defined for user 'fake_user' on host 'localhost' on routine 'b54866_f'
197 REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'fake_user'@'localhost';
198 ERROR HY000: Can't revoke all privileges for one or more of the requested users
199 include/sync_slave_sql_with_master.inc
200 ##########
201 ########## Cleanup
202 ##########
203 DROP PROCEDURE b54866_p;
204 DROP FUNCTION b54866_f;
205 DROP USER 'b54866_user'@'localhost';
206 DROP DATABASE b54866;
207 include/sync_slave_sql_with_master.inc
208 include/rpl_reset.inc
209 CREATE USER foo IDENTIFIED WITH 'my_plugin';
210 ERROR HY000: Plugin 'my_plugin' is not loaded
211 include/sync_slave_sql_with_master.inc
212 # Search for occurrences of CREATE USER in the output from mysqlbinlog
213 - Occurrences: 0
214 include/rpl_end.inc