summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_grant.test
blob: 71e3634258498c56b26aaec558824c3516fd0a00 (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
# 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 != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user;
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user;

--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 != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user;
sync_slave_with_master;
--echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user != 'root'; # root host non-determ
SELECT COUNT(*) FROM mysql.user;

--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 #
query_vertical SHOW SLAVE STATUS;