~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
4
 
--disable_warnings
5
 
drop table if exists t1, t2;
6
 
--enable_warnings
 
4
source include/have_innodb.inc;
 
5
 
7
6
create table t1 (a int);
8
7
--error 1051
9
8
drop table t1, t2;
10
 
save_master_pos;
 
9
--sync_slave_with_master
 
10
 
 
11
# End of 4.1 tests
 
12
 
 
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.
 
21
#
 
22
# In the test case, we verify if the binary log contains no information for a
 
23
# CREATE...SELECT that fails.
11
24
connection slave;
12
 
sync_with_master;
13
 
 
14
 
# End of 4.1 tests
15
 
 
16
 
 
 
25
 
 
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
 
30
 
 
31
connection master;
 
32
SET @old_binlog_format= @@global.binlog_format;
 
33
SET binlog_format = ROW;
 
34
 
 
35
CREATE TABLE t2(a INT) ENGINE=MYISAM;
 
36
CREATE TABLE t3(a INT) ENGINE=INNODB;
 
37
 
 
38
delimiter |;
 
39
CREATE FUNCTION f1() RETURNS INT
 
40
BEGIN
 
41
  insert into t2 values(1);
 
42
  insert into t3 values(1);
 
43
  return 1;
 
44
END|
 
45
delimiter ;|
 
46
 
 
47
let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1);
 
48
let $binlog_file= query_get_value("SHOW MASTER STATUS", File, 1);
 
49
 
 
50
--error 1062
 
51
CREATE TABLE t1(UNIQUE(a)) ENGINE=MYISAM SELECT 1 AS a UNION ALL SELECT f1();
 
52
--error 1062
 
53
CREATE TABLE t1(UNIQUE(a)) ENGINE=INNODB SELECT 1 AS a UNION ALL SELECT f1();
 
54
 
 
55
--source include/show_binlog_events.inc
 
56
 
 
57
DROP FUNCTION f1;
 
58
DROP TABLE t2, t3;
 
59
SET @@global.binlog_format= @old_binlog_format;
 
60
 
 
61
--sync_slave_with_master
 
62
SET @@global.binlog_format= @old_binlog_format;
 
63
 
 
64
# End of 5.1 tests
 
65
 
 
66
--source include/rpl_end.inc