mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
6a51e0f8a2
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-rpl
70 lines
2.2 KiB
Text
70 lines
2.2 KiB
Text
--source include/have_ndb.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_binlog_format_mixed_or_statement.inc
|
|
--source include/ndb_master-slave.inc
|
|
|
|
--connection master
|
|
create table t1 (a int key, b int) engine innodb;
|
|
create table t2 (a int key, b int) engine innodb;
|
|
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
alter table t1 engine ndb;
|
|
alter table t2 engine ndb;
|
|
|
|
# We need MIXED mode on the slave in the event that there are
|
|
# statements coming in from the master. In this case, NDB can only
|
|
# handle row-based format, so it has to be possible to switch to
|
|
# this.
|
|
STOP SLAVE;
|
|
SET GLOBAL BINLOG_FORMAT=MIXED;
|
|
START SLAVE;
|
|
|
|
# check binlog position without begin
|
|
--connection master
|
|
insert into t1 values (1,2);
|
|
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
--replace_column 1 <start_pos> 2 <end_pos>
|
|
select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
|
|
--let $start_pos = `select @start_pos`
|
|
--let $end_pos = `select @end_pos`
|
|
|
|
--connection master
|
|
# here is actually a bug, since there is no begin statement, the
|
|
# query is autocommitted, and end_pos shows end of the insert and not
|
|
# end of the commit
|
|
--replace_result $start_pos <start_pos>
|
|
--replace_column 5 #
|
|
--eval show binlog events from $start_pos limit 1
|
|
--replace_result $start_pos <start_pos> $end_pos <end_pos>
|
|
--replace_column 2 #
|
|
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
|
--eval show binlog events from $start_pos limit 1,1
|
|
|
|
# check binlog position with begin
|
|
--connection master
|
|
begin;
|
|
insert into t1 values (2,3);
|
|
insert into t2 values (3,4);
|
|
commit;
|
|
|
|
--sync_slave_with_master
|
|
--connection slave
|
|
--replace_column 1 <start_pos> 2 <end_pos>
|
|
select @start_pos:=start_pos, @end_pos:=end_pos from mysql.ndb_apply_status;
|
|
--let $start_pos = `select @start_pos`
|
|
--let $end_pos = `select @end_pos`
|
|
|
|
--connection master
|
|
--replace_result $start_pos <start_pos>
|
|
--replace_column 5 #
|
|
--eval show binlog events from $start_pos limit 1
|
|
--replace_result $start_pos <start_pos>
|
|
--replace_column 2 # 4 # 5 #
|
|
--eval show binlog events from $start_pos limit 1,2
|
|
--replace_result $start_pos <start_pos> $end_pos <end_pos>
|
|
--replace_column 2 #
|
|
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
|
|
--eval show binlog events from $start_pos limit 3,1
|