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).
7
-- source include/have_binlog_format_mixed_or_statement.inc
9
source include/master-slave.inc;
11
# see if DROP DATABASE is binlogged even if no effect
13
create database mysqltest;
15
drop database if exists mysqltest;
16
sync_slave_with_master;
18
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
20
show tables from mysqltest;
22
# see if DROP TABLE is binlogged even if no effect
24
create table t1 (a int);
26
drop table if exists t1;
27
sync_slave_with_master;
28
# table does not exist
32
# see if single-table DELETE is binlogged even if no effect
34
create table t1 (a int, b int);
35
sync_slave_with_master;
36
insert into t1 values(1,1);
39
sync_slave_with_master;
42
# see if single-table UPDATE is binlogged even if no effect
43
insert into t1 values(1,1);
45
insert into t1 values(2,1);
47
sync_slave_with_master;
52
# see if multi-table UPDATE is binlogged even if no effect (BUG#13348)
55
create table t2 (a int, b int);
57
insert into t1 values(1,1);
58
insert into t2 values(1,1);
60
sync_slave_with_master;
61
# force a difference to see if master's multi-UPDATE will correct it
65
UPDATE t1, t2 SET t1.a = t2.a;
67
sync_slave_with_master;
71
# See if multi-table DELETE is binlogged even if no effect
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);
83
DELETE t1.*, t2.* from t1, t2;
85
sync_slave_with_master;
93
sync_slave_with_master;