summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_grant.test
blob: 6fbdafc0f9c681ebd58145792c35820bca043ab3 (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
# Tests of grants and users

source include/master-slave.inc;
source include/not_embedded.inc;

--echo **** On Master ****
connection master;

CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost;

SELECT user, host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';

--echo **** On Master ****
connection master;

# No user exists
error ER_CANNOT_USER;
DROP USER nonexisting@localhost;

# At least one user exists, but not all
error ER_CANNOT_USER;
DROP USER nonexisting@localhost, dummy@localhost;

# All users exist
DROP USER dummy1@localhost, dummy2@localhost;

SELECT user, host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';