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

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_stm_no_op.test

  • 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
# It's true only in statement-based replication that a statement which
 
2
# updates no rows (UPDATE/DELETE) is binlogged; in row-based
 
3
# replication, as we log modified rows, nothing is binlogged in this
 
4
# case. So this test is meaningul only in statement-based (and if it was
 
5
# enabled in row-based, it would fail as expected).
 
6
 
 
7
-- source include/have_binlog_format_mixed_or_statement.inc
 
8
 
 
9
source include/master-slave.inc;
 
10
 
 
11
# see if DROP DATABASE is binlogged even if no effect
 
12
connection slave;
 
13
create database mysqltest;
 
14
connection master;
 
15
drop database if exists mysqltest;
 
16
sync_slave_with_master;
 
17
# can't read dir
 
18
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
 
19
--error 1049
 
20
show tables from mysqltest;
 
21
 
 
22
# see if DROP TABLE is binlogged even if no effect
 
23
connection slave;
 
24
create table t1 (a int);
 
25
connection master;
 
26
drop table if exists t1;
 
27
sync_slave_with_master;
 
28
# table does not exist
 
29
--error 1146
 
30
select * from t1;
 
31
 
 
32
# see if single-table DELETE is binlogged even if no effect
 
33
connection master;
 
34
create table t1 (a int, b int);
 
35
sync_slave_with_master;
 
36
insert into t1 values(1,1);
 
37
connection master;
 
38
delete from t1;
 
39
sync_slave_with_master;
 
40
select * from t1;
 
41
 
 
42
# see if single-table UPDATE is binlogged even if no effect
 
43
insert into t1 values(1,1);
 
44
connection master;
 
45
insert into t1 values(2,1);
 
46
update t1 set a=2;
 
47
sync_slave_with_master;
 
48
select * from t1;
 
49
 
 
50
# End of 4.1 tests
 
51
 
 
52
# see if multi-table UPDATE is binlogged even if no effect (BUG#13348)
 
53
 
 
54
connection master;
 
55
create table t2 (a int, b int);
 
56
delete from t1;
 
57
insert into t1 values(1,1);
 
58
insert into t2 values(1,1);
 
59
 
 
60
sync_slave_with_master;
 
61
# force a difference to see if master's multi-UPDATE will correct it
 
62
update t1 set a=2;
 
63
 
 
64
connection master;
 
65
UPDATE t1, t2 SET t1.a = t2.a;
 
66
 
 
67
sync_slave_with_master;
 
68
select * from t1;
 
69
select * from t2;
 
70
 
 
71
# See if multi-table DELETE is binlogged even if no effect
 
72
 
 
73
connection master;
 
74
delete from t1;
 
75
delete from t2;
 
76
 
 
77
sync_slave_with_master;
 
78
# force a difference to see if master's multi-DELETE will correct it
 
79
insert into t1 values(1,1);
 
80
insert into t2 values(1,1);
 
81
 
 
82
connection master;
 
83
DELETE t1.*, t2.* from t1, t2;
 
84
 
 
85
sync_slave_with_master;
 
86
select * from t1;
 
87
select * from t2;
 
88
 
 
89
 
 
90
# cleanup
 
91
connection master;
 
92
drop table t1, t2;
 
93
sync_slave_with_master;