30
sync_slave_with_master;
31
sync_slave_with_master;
35
# Bug#25482 GRANT statements are not replicated if
36
# you use "replicate-ignore-table"
39
--echo **** Test case for BUG#25482 ****
40
--echo **** Adding GRANTS on master ****
43
create table test.t1(a int);
44
create table test.t4(a int);
46
# Simple user that should not replicate
47
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
50
GRANT INSERT ON test.t4 TO mysqltest2@localhost;
51
GRANT select, update, insert, references on t1
52
to mysqltest2@localhost;
55
GRANT SELECT ON test.* TO mysqltest3@localhost;
56
GRANT INSERT ON test.t4 TO mysqltest3@localhost;
57
GRANT select(a), update(a), insert(a), references(a) on t4
58
to mysqltest3@localhost;
60
# Create another database and table
61
create database mysqltest2;
62
create table mysqltest2.t2 (id int);
63
# Create a grant that should replicate
64
GRANT SELECT ON mysqltest2.t2 TO mysqltest4@localhost IDENTIFIED BY 'pass';
66
# Create a grant manually
67
insert into mysql.user (user, host) values ("mysqltest5", "somehost");
69
# Partial replicate 3 with *.*
70
GRANT SELECT ON *.* TO mysqltest6@localhost;
71
GRANT INSERT ON *.* TO mysqltest6@localhost;
72
GRANT INSERT ON test.* TO mysqltest6@localhost;
73
GRANT INSERT ON test.t1 TO mysqltest6@localhost;
75
show grants for mysqltest1@localhost;
76
show grants for mysqltest2@localhost;
77
show grants for mysqltest3@localhost;
78
show grants for mysqltest4@localhost;
79
show grants for mysqltest6@localhost;
82
show grants for mysqltest5@somehost;
85
sync_slave_with_master;
87
--echo **** Checking grants on slave ****
89
# Check that grants are replicated to slave
90
show grants for mysqltest2@localhost;
91
show grants for mysqltest3@localhost;
92
show grants for mysqltest4@localhost;
93
show grants for mysqltest5@somehost;
94
show grants for mysqltest6@localhost;
96
# mysqltest1 should not be on slave
98
show grants for mysqltest1@localhost;
100
--echo **** Revoking grants on master ****
102
REVOKE SELECT ON test.t1 FROM mysqltest1@localhost;
103
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost;
104
REVOKE select(a) on t4
105
from mysqltest3@localhost;
107
show grants for mysqltest1@localhost;
108
show grants for mysqltest3@localhost;
109
show grants for mysqltest4@localhost;
111
sync_slave_with_master;
113
--echo **** Checking grants on slave ****
115
# mysqltest1 should not be on slave
117
show grants for mysqltest1@localhost;
118
show grants for mysqltest3@localhost;
119
show grants for mysqltest4@localhost;
123
drop table t1, t4, mysqltest2.t2;
124
drop database mysqltest2;
125
delete from mysql.user where user like "mysqltest%";
126
delete from mysql.db where user like "mysqltest%";
128
# BUG 27606 causes failure to replicate this statement
129
# move it to slave instead
130
#delete from mysql.tables_priv where user like "mysqltest%";
131
delete from mysql.columns_priv where user like "mysqltest%";
132
sync_slave_with_master;
135
delete from mysql.tables_priv where user like "mysqltest%";
140
delete from mysql.tables_priv where user like "mysqltest%";
33
143
# bug#22877 replication character sets get out of sync