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

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

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%';

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;
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';

--source include/rpl_end.inc