~mdcallag/+junk/5.1-map

« back to all changes in this revision

Viewing changes to mysql-test/t/rpl_ignore_table.test

  • Committer: msvensson at pilot
  • Date: 2007-04-24 09:11:45 UTC
  • mfrom: (2469.1.106)
  • Revision ID: sp1r-msvensson@pilot.blaudden-20070424091145-10463
Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
connection master;
28
28
DROP TABLE t1;
29
29
DROP TABLE t4;
30
 
sync_slave_with_master;
 
30
 
 
31
sync_slave_with_master;
 
32
 
 
33
 
 
34
#
 
35
# Bug#25482 GRANT statements are not replicated if
 
36
# you use "replicate-ignore-table"
 
37
#
 
38
 
 
39
--echo **** Test case for BUG#25482 ****
 
40
--echo **** Adding GRANTS on master ****
 
41
 
 
42
connection master;
 
43
create table test.t1(a int);
 
44
create table test.t4(a int);
 
45
 
 
46
# Simple user that should not replicate
 
47
GRANT SELECT ON test.t1 TO mysqltest1@localhost;
 
48
 
 
49
# Partial replicate
 
50
GRANT INSERT ON test.t4 TO mysqltest2@localhost;
 
51
GRANT select, update, insert, references on t1
 
52
  to mysqltest2@localhost;
 
53
 
 
54
# Partial replicate 2
 
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;
 
59
 
 
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';
 
65
 
 
66
# Create a grant manually
 
67
insert into mysql.user (user, host) values ("mysqltest5", "somehost");
 
68
 
 
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;
 
74
 
 
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;
 
80
 
 
81
flush privileges;
 
82
show grants for mysqltest5@somehost;
 
83
 
 
84
 
 
85
sync_slave_with_master;
 
86
 
 
87
--echo **** Checking grants on slave ****
 
88
 
 
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;
 
95
 
 
96
# mysqltest1 should not be on slave
 
97
--error 1141
 
98
show grants for mysqltest1@localhost;
 
99
 
 
100
--echo **** Revoking grants on master ****
 
101
connection 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;
 
106
 
 
107
show grants for mysqltest1@localhost;
 
108
show grants for mysqltest3@localhost;
 
109
show grants for mysqltest4@localhost;
 
110
 
 
111
sync_slave_with_master;
 
112
 
 
113
--echo **** Checking grants on slave ****
 
114
 
 
115
# mysqltest1 should not be on slave
 
116
--error 1141
 
117
show grants for mysqltest1@localhost;
 
118
show grants for mysqltest3@localhost;
 
119
show grants for mysqltest4@localhost;
 
120
 
 
121
# Cleanup
 
122
connection master;
 
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%";
 
127
#
 
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;
 
133
 
 
134
#BUG27606
 
135
delete from mysql.tables_priv where user like "mysqltest%";
 
136
 
 
137
connection master;
 
138
 
 
139
#BUG27606
 
140
delete from mysql.tables_priv where user like "mysqltest%";
31
141
 
32
142
#
33
143
# bug#22877 replication character sets get out of sync