mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
511ef0cc29
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-rpl mysql-test/extra/rpl_tests/rpl_log.test: Auto merged mysql-test/extra/rpl_tests/rpl_row_basic.test: Auto merged mysql-test/t/rpl_ndb_bank.test: Auto merged mysql-test/t/rpl_ndb_basic.test: Auto merged mysql-test/t/rpl_ndb_do_table.test: Auto merged mysql-test/t/rpl_ndb_idempotent.test: Auto merged mysql-test/t/rpl_ndb_stm_innodb.test: Auto merged mysql-test/t/rpl_ndb_sync.test: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged storage/ndb/test/run-test/daily-basic-tests.txt: Auto merged mysql-test/include/have_multi_ndb.inc: manual merge mysql-test/include/have_ndb.inc: manual merge mysql-test/t/rpl_ndb_commit_afterflush.test: manual merge mysql-test/t/rpl_ndb_ddl.test: manual merge mysql-test/t/rpl_ndb_innodb_trans.test: manual merge
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
|