1
1
# Testcase for BUG#4552 (DROP on two tables, one of which does not
2
2
# exist, must be binlogged with a non-zero error code)
3
3
source include/master-slave.inc;
5
drop table if exists t1, t2;
4
source include/have_innodb.inc;
7
6
create table t1 (a int);
9
--sync_slave_with_master
13
# BUG#55625 RBR breaks on failing 'CREATE TABLE'
14
# A CREATE...SELECT that fails is written to the binary log if a non-transactional
15
# statement is updated. If the logging format is ROW, the CREATE statement and the
16
# changes are written to the binary log as distinct events and by consequence the
17
# created table is not rolled back in the slave.
18
# To fix the problem, we do not write a CREATE...SELECT that fails to the binary
19
# log. Howerver, the changes to non-transactional tables are not replicated and
20
# thus the slave goes out of sync. This should be fixed after BUG#47899.
22
# In the test case, we verify if the binary log contains no information for a
23
# CREATE...SELECT that fails.
26
--source include/stop_slave.inc
27
SET @old_binlog_format= @@global.binlog_format;
28
SET GLOBAL binlog_format = ROW;
29
--source include/start_slave.inc
32
SET @old_binlog_format= @@global.binlog_format;
33
SET binlog_format = ROW;
35
CREATE TABLE t2(a INT) ENGINE=MYISAM;
36
CREATE TABLE t3(a INT) ENGINE=INNODB;
39
CREATE FUNCTION f1() RETURNS INT
41
insert into t2 values(1);
42
insert into t3 values(1);
47
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
48
let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1);
51
CREATE TABLE t1(UNIQUE(a)) ENGINE=MYISAM SELECT 1 AS a UNION ALL SELECT f1();
53
CREATE TABLE t1(UNIQUE(a)) ENGINE=INNODB SELECT 1 AS a UNION ALL SELECT f1();
55
--source include/show_binlog_events.inc
59
SET @@global.binlog_format= @old_binlog_format;
61
--sync_slave_with_master
62
SET @@global.binlog_format= @old_binlog_format;
66
--source include/rpl_end.inc