--source include/have_ndb.inc --source include/have_innodb.inc --source include/have_binlog_format_mixed_or_statement.inc --source include/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; # check binlog position without begin --connection master insert into t1 values (1,2); --sync_slave_with_master --connection slave --replace_column 1 2 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 --replace_column 5 # --eval show binlog events from $start_pos limit 1 --replace_result $start_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 2 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 --replace_column 5 # --eval show binlog events from $start_pos limit 1 --replace_result $start_pos --replace_column 2 # 4 # 5 # --eval show binlog events from $start_pos limit 1,2 --replace_result $start_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 DROP TABLE t1,t2; --sync_slave_with_master --connection master CREATE TABLE t1 (c1 INT AUTO_INCREMENT NOT NULL PRIMARY KEY, c2 INT NOT NULL, c3 INT NOT NULL); SHOW CREATE TABLE t1; --echo ***** insert some data ***** let $j= 10; --disable_query_log while ($j) { eval INSERT INTO t1 VALUES(NULL,$j*2,$j+3); dec $j; } --enable_query_log --sync_slave_with_master --connection slave SHOW CREATE TABLE t1; --replace_column 1 2 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 --replace_column 5 # --eval show binlog events from $start_pos limit 1 --replace_result $start_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 set autocommit=0; let $j= 10; --disable_query_log START TRANSACTION; while ($j) { eval INSERT INTO t1 VALUES(NULL,$j*2,$j+3); dec $j; } COMMIT; --enable_query_log --sync_slave_with_master --connection slave select * from mysql.ndb_apply_status; --replace_column 1 2 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 SHOW BINLOG EVENTS; # 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 --replace_column 5 # --eval show binlog events from $start_pos limit 1 --replace_result $start_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 --sync_slave_with_master select * from mysql.ndb_apply_status;