~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/r/rpl_slave_skip.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
stop slave;
 
2
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
3
reset master;
 
4
reset slave;
 
5
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 
6
start slave;
 
7
**** On Slave ****
 
8
STOP SLAVE;
 
9
**** On Master ****
 
10
SET SESSION BINLOG_FORMAT=ROW;
 
11
CREATE TABLE t1 (a INT, b INT);
 
12
CREATE TABLE t2 (c INT, d INT);
 
13
INSERT INTO t1 VALUES (1,1),(2,4),(3,9);
 
14
INSERT INTO t2 VALUES (1,1),(2,8),(3,27);
 
15
UPDATE t1,t2 SET b = d, d = b * 2 WHERE a = c;
 
16
show binlog events from <binlog_start>;
 
17
Log_name        Pos     Event_type      Server_id       End_log_pos     Info
 
18
master-bin.000001       #       Query   #       #       use `test`; CREATE TABLE t1 (a INT, b INT)
 
19
master-bin.000001       #       Query   #       #       use `test`; CREATE TABLE t2 (c INT, d INT)
 
20
master-bin.000001       #       Query   #       #       BEGIN
 
21
master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
 
22
master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
 
23
master-bin.000001       #       Query   #       #       COMMIT
 
24
master-bin.000001       #       Query   #       #       BEGIN
 
25
master-bin.000001       #       Table_map       #       #       table_id: # (test.t2)
 
26
master-bin.000001       #       Write_rows      #       #       table_id: # flags: STMT_END_F
 
27
master-bin.000001       #       Query   #       #       COMMIT
 
28
master-bin.000001       #       Query   #       #       BEGIN
 
29
master-bin.000001       #       Table_map       #       #       table_id: # (test.t1)
 
30
master-bin.000001       #       Table_map       #       #       table_id: # (test.t2)
 
31
master-bin.000001       #       Update_rows     #       #       table_id: #
 
32
master-bin.000001       #       Update_rows     #       #       table_id: # flags: STMT_END_F
 
33
master-bin.000001       #       Query   #       #       COMMIT
 
34
SELECT * FROM t1;
 
35
a       b
 
36
1       1
 
37
2       8
 
38
3       27
 
39
SELECT * FROM t2;
 
40
c       d
 
41
1       2
 
42
2       8
 
43
3       18
 
44
**** On Slave ****
 
45
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762;
 
46
SHOW SLAVE STATUS;
 
47
Slave_IO_State  #
 
48
Master_Host     127.0.0.1
 
49
Master_User     root
 
50
Master_Port     MASTER_PORT
 
51
Connect_Retry   1
 
52
Master_Log_File master-bin.000001
 
53
Read_Master_Log_Pos     1115
 
54
Relay_Log_File  #
 
55
Relay_Log_Pos   #
 
56
Relay_Master_Log_File   master-bin.000001
 
57
Slave_IO_Running        Yes
 
58
Slave_SQL_Running       No
 
59
Replicate_Do_DB 
 
60
Replicate_Ignore_DB     
 
61
Replicate_Do_Table      
 
62
Replicate_Ignore_Table  
 
63
Replicate_Wild_Do_Table 
 
64
Replicate_Wild_Ignore_Table     
 
65
Last_Errno      0
 
66
Last_Error      
 
67
Skip_Counter    0
 
68
Exec_Master_Log_Pos     762
 
69
Relay_Log_Space #
 
70
Until_Condition Master
 
71
Until_Log_File  master-bin.000001
 
72
Until_Log_Pos   762
 
73
Master_SSL_Allowed      No
 
74
Master_SSL_CA_File      
 
75
Master_SSL_CA_Path      
 
76
Master_SSL_Cert 
 
77
Master_SSL_Cipher       
 
78
Master_SSL_Key  
 
79
Seconds_Behind_Master   #
 
80
Master_SSL_Verify_Server_Cert   No
 
81
Last_IO_Errno   #
 
82
Last_IO_Error   #
 
83
Last_SQL_Errno  0
 
84
Last_SQL_Error  
 
85
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
86
START SLAVE;
 
87
SELECT * FROM t1;
 
88
a       b
 
89
1       1
 
90
2       4
 
91
3       9
 
92
SELECT * FROM t2;
 
93
c       d
 
94
1       1
 
95
2       8
 
96
3       27
 
97
STOP SLAVE;
 
98
RESET SLAVE;
 
99
RESET MASTER;
 
100
SET SESSION BINLOG_FORMAT=STATEMENT;
 
101
SET @foo = 12;
 
102
INSERT INTO t1 VALUES(@foo, 2*@foo);
 
103
show binlog events from <binlog_start>;
 
104
Log_name        Pos     Event_type      Server_id       End_log_pos     Info
 
105
master-bin.000001       #       User var        #       #       @`foo`=12
 
106
master-bin.000001       #       Query   #       #       use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
 
107
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106;
 
108
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
109
START SLAVE;
 
110
SHOW SLAVE STATUS;
 
111
Slave_IO_State  #
 
112
Master_Host     127.0.0.1
 
113
Master_User     root
 
114
Master_Port     MASTER_PORT
 
115
Connect_Retry   1
 
116
Master_Log_File master-bin.000001
 
117
Read_Master_Log_Pos     248
 
118
Relay_Log_File  #
 
119
Relay_Log_Pos   #
 
120
Relay_Master_Log_File   master-bin.000001
 
121
Slave_IO_Running        Yes
 
122
Slave_SQL_Running       Yes
 
123
Replicate_Do_DB 
 
124
Replicate_Ignore_DB     
 
125
Replicate_Do_Table      
 
126
Replicate_Ignore_Table  
 
127
Replicate_Wild_Do_Table 
 
128
Replicate_Wild_Ignore_Table     
 
129
Last_Errno      0
 
130
Last_Error      
 
131
Skip_Counter    0
 
132
Exec_Master_Log_Pos     248
 
133
Relay_Log_Space #
 
134
Until_Condition None
 
135
Until_Log_File  
 
136
Until_Log_Pos   0
 
137
Master_SSL_Allowed      No
 
138
Master_SSL_CA_File      
 
139
Master_SSL_CA_Path      
 
140
Master_SSL_Cert 
 
141
Master_SSL_Cipher       
 
142
Master_SSL_Key  
 
143
Seconds_Behind_Master   #
 
144
Master_SSL_Verify_Server_Cert   No
 
145
Last_IO_Errno   #
 
146
Last_IO_Error   #
 
147
Last_SQL_Errno  0
 
148
Last_SQL_Error  
 
149
**** On Master ****
 
150
DROP TABLE t1, t2;
 
151
SET SESSION BINLOG_FORMAT=ROW;
 
152
SET AUTOCOMMIT=0;
 
153
CREATE TABLE t1 (a INT, b VARCHAR(20)) ENGINE=myisam;
 
154
CREATE TABLE t2 (a INT, b VARCHAR(20)) ENGINE=myisam;
 
155
CREATE TABLE t3 (a INT, b VARCHAR(20)) ENGINE=myisam;
 
156
INSERT INTO t1 VALUES (1,'master/slave');
 
157
INSERT INTO t2 VALUES (1,'master/slave');
 
158
INSERT INTO t3 VALUES (1,'master/slave');
 
159
CREATE TRIGGER tr1 AFTER UPDATE on t1 FOR EACH ROW
 
160
BEGIN
 
161
INSERT INTO t2 VALUES (NEW.a,NEW.b);
 
162
DELETE FROM t2 WHERE a < NEW.a;
 
163
END|
 
164
CREATE TRIGGER tr2 AFTER INSERT on t2 FOR EACH ROW
 
165
BEGIN
 
166
UPDATE t3 SET a =2, b = 'master only';
 
167
END|
 
168
**** On Slave ****
 
169
include/stop_slave.inc
 
170
**** On Master ****
 
171
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
 
172
DROP TRIGGER tr1;
 
173
DROP TRIGGER tr2;
 
174
INSERT INTO t1 VALUES (3,'master/slave');
 
175
INSERT INTO t2 VALUES (3,'master/slave');
 
176
INSERT INTO t3 VALUES (3,'master/slave');
 
177
COMMIT;
 
178
SELECT * FROM t1 ORDER BY a;
 
179
a       b
 
180
2       master only
 
181
3       master/slave
 
182
SELECT * FROM t2 ORDER BY a;
 
183
a       b
 
184
2       master only
 
185
3       master/slave
 
186
SELECT * FROM t3 ORDER BY a;
 
187
a       b
 
188
2       master only
 
189
3       master/slave
 
190
*** On Slave ***
 
191
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
192
include/start_slave.inc
 
193
SELECT * FROM t1 ORDER BY a;
 
194
a       b
 
195
1       master/slave
 
196
3       master/slave
 
197
SELECT * FROM t2 ORDER BY a;
 
198
a       b
 
199
1       master/slave
 
200
3       master/slave
 
201
SELECT * FROM t3 ORDER BY a;
 
202
a       b
 
203
1       master/slave
 
204
3       master/slave
 
205
DROP TABLE t1, t2, t3;
 
206
**** Case 2: Row binlog format and transactional tables ****
 
207
*** On Master ***
 
208
CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
 
209
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
 
210
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
 
211
**** On Slave ****
 
212
include/stop_slave.inc
 
213
*** On Master ***
 
214
BEGIN;
 
215
INSERT INTO t4 VALUES (2, 'master only');
 
216
INSERT INTO t5 VALUES (2, 'master only');
 
217
INSERT INTO t6 VALUES (2, 'master only');
 
218
COMMIT;
 
219
BEGIN;
 
220
INSERT INTO t4 VALUES (3, 'master/slave');
 
221
INSERT INTO t5 VALUES (3, 'master/slave');
 
222
INSERT INTO t6 VALUES (3, 'master/slave');
 
223
COMMIT;
 
224
SELECT * FROM t4 ORDER BY a;
 
225
a       b
 
226
2       master only
 
227
3       master/slave
 
228
SELECT * FROM t5 ORDER BY a;
 
229
a       b
 
230
2       master only
 
231
3       master/slave
 
232
SELECT * FROM t6 ORDER BY a;
 
233
a       b
 
234
2       master only
 
235
3       master/slave
 
236
*** On Slave ***
 
237
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
238
include/start_slave.inc
 
239
SELECT * FROM t4 ORDER BY a;
 
240
a       b
 
241
3       master/slave
 
242
SELECT * FROM t5 ORDER BY a;
 
243
a       b
 
244
3       master/slave
 
245
SELECT * FROM t6 ORDER BY a;
 
246
a       b
 
247
3       master/slave
 
248
**** On Slave ****
 
249
include/stop_slave.inc
 
250
*** On Master ***
 
251
BEGIN;
 
252
INSERT INTO t4 VALUES (6, 'master only');
 
253
INSERT INTO t5 VALUES (6, 'master only');
 
254
INSERT INTO t6 VALUES (6, 'master only');
 
255
COMMIT;
 
256
BEGIN;
 
257
INSERT INTO t4 VALUES (7, 'master only');
 
258
INSERT INTO t5 VALUES (7, 'master only');
 
259
INSERT INTO t6 VALUES (7, 'master only');
 
260
COMMIT;
 
261
SELECT * FROM t4 ORDER BY a;
 
262
a       b
 
263
2       master only
 
264
3       master/slave
 
265
6       master only
 
266
7       master only
 
267
SELECT * FROM t5 ORDER BY a;
 
268
a       b
 
269
2       master only
 
270
3       master/slave
 
271
6       master only
 
272
7       master only
 
273
SELECT * FROM t6 ORDER BY a;
 
274
a       b
 
275
2       master only
 
276
3       master/slave
 
277
6       master only
 
278
7       master only
 
279
*** On Slave ***
 
280
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
 
281
include/start_slave.inc
 
282
SELECT * FROM t4 ORDER BY a;
 
283
a       b
 
284
3       master/slave
 
285
SELECT * FROM t5 ORDER BY a;
 
286
a       b
 
287
3       master/slave
 
288
SELECT * FROM t6 ORDER BY a;
 
289
a       b
 
290
3       master/slave
 
291
include/stop_slave.inc
 
292
SET AUTOCOMMIT=0;
 
293
INSERT INTO t4 VALUES (4, 'master only');
 
294
INSERT INTO t5 VALUES (4, 'master only');
 
295
INSERT INTO t6 VALUES (4, 'master only');
 
296
COMMIT;
 
297
INSERT INTO t4 VALUES (5, 'master/slave');
 
298
INSERT INTO t5 VALUES (5, 'master/slave');
 
299
INSERT INTO t6 VALUES (5, 'master/slave');
 
300
COMMIT;
 
301
SELECT * FROM t4 ORDER BY a;
 
302
a       b
 
303
2       master only
 
304
3       master/slave
 
305
4       master only
 
306
5       master/slave
 
307
6       master only
 
308
7       master only
 
309
SELECT * FROM t5 ORDER BY a;
 
310
a       b
 
311
2       master only
 
312
3       master/slave
 
313
4       master only
 
314
5       master/slave
 
315
6       master only
 
316
7       master only
 
317
SELECT * FROM t6 ORDER BY a;
 
318
a       b
 
319
2       master only
 
320
3       master/slave
 
321
4       master only
 
322
5       master/slave
 
323
6       master only
 
324
7       master only
 
325
*** On Slave ***
 
326
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
327
include/start_slave.inc
 
328
SELECT * FROM t4 ORDER BY a;
 
329
a       b
 
330
3       master/slave
 
331
5       master/slave
 
332
SELECT * FROM t5 ORDER BY a;
 
333
a       b
 
334
3       master/slave
 
335
5       master/slave
 
336
SELECT * FROM t6 ORDER BY a;
 
337
a       b
 
338
3       master/slave
 
339
5       master/slave
 
340
DROP TABLE t4, t5, t6;
 
341
**** Case 3: Statement logging format and LOAD DATA with non-transactional table ****
 
342
*** On Master ***
 
343
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
 
344
*** On Slave ***
 
345
include/stop_slave.inc
 
346
*** On Master ***
 
347
SET SESSION BINLOG_FORMAT=STATEMENT;
 
348
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
 
349
SELECT * FROM t10 ORDER BY a;
 
350
a       b
 
351
1       master only
 
352
2       master only
 
353
3       master only
 
354
*** On Slave ***
 
355
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 
356
include/start_slave.inc
 
357
SELECT * FROM t10 ORDER BY a;
 
358
a       b
 
359
DROP TABLE t10;