List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:April 14 2011 8:14am
Subject:bzr push into mysql-5.5-cluster branch (magnus.blaudd:3278 to 3279)
View as plain text  
 3279 Magnus Blåudd	2011-04-14 [merge]
      Merge 7.0 -> 5.5-cluster

    modified:
      mysql-test/suite/ndb/r/ndb_basic.result
      mysql-test/suite/ndb/t/ndb_basic.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_add_column.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_bitfield.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_bug22045.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_check_for_mixed.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max_delete_win.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_old.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_empty_epoch.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_gap_event.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_ignore_db.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_logging.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_error.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_skip_gap_event.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu_anyval.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_restart.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result
      mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result
      mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result
      mysql-test/suite/rpl_ndb/t/ndb_conflict_info.inc
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_add_column.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_bitfield.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_bug22045.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max_delete_win.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_old.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_empty_epoch.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_logging.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_eng_trans.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_lsu.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_restart.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test
      mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test
      mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test
      mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test
      storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp
      storage/ndb/include/portlib/ndb_socket_posix.h
      storage/ndb/include/portlib/ndb_socket_win32.h
      storage/ndb/include/util/HashMap.hpp
      storage/ndb/include/util/UtilBuffer.hpp
      storage/ndb/include/util/Vector.hpp
      storage/ndb/src/common/debugger/EventLogger.cpp
      storage/ndb/src/common/transporter/TCP_Transporter.cpp
      storage/ndb/src/common/transporter/TransporterRegistry.cpp
      storage/ndb/src/common/util/File.cpp
      storage/ndb/src/common/util/socket_io.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/mgmsrv/Services.cpp
      storage/ndb/test/ndbapi/bank/Bank.cpp
      storage/ndb/test/ndbapi/testBasic.cpp
      storage/ndb/test/ndbapi/testDict.cpp
      storage/ndb/test/ndbapi/testIndex.cpp
      storage/ndb/test/ndbapi/testLcp.cpp
      storage/ndb/test/ndbapi/testNodeRestart.cpp
      storage/ndb/test/ndbapi/testReadPerf.cpp
      storage/ndb/test/ndbapi/testSRBank.cpp
      storage/ndb/test/ndbapi/testScan.cpp
      storage/ndb/test/ndbapi/testScanPerf.cpp
      storage/ndb/test/ndbapi/testTimeout.cpp
      storage/ndb/test/ndbapi/test_event.cpp
      storage/ndb/test/src/HugoOperations.cpp
      storage/ndb/test/tools/verify_index.cpp
      storage/ndb/tools/ndb_test_platform.cpp
 3278 Magnus Blåudd	2011-04-11 [merge]
      Merge 7.0 -> 5.5-telco-7.0

    added:
      storage/ndb/src/ndbapi/NdbQueryBuilder.cpp
      storage/ndb/src/ndbapi/NdbQueryBuilder.hpp
      storage/ndb/src/ndbapi/NdbQueryBuilderImpl.hpp
      storage/ndb/src/ndbapi/NdbQueryOperation.cpp
      storage/ndb/src/ndbapi/NdbQueryOperation.hpp
      storage/ndb/src/ndbapi/NdbQueryOperationImpl.hpp
      storage/ndb/test/include/HugoQueries.hpp
      storage/ndb/test/include/HugoQueryBuilder.hpp
      storage/ndb/test/ndbapi/testSpj.cpp
      storage/ndb/test/rqg/
      storage/ndb/test/rqg/runall.sh
      storage/ndb/test/rqg/simple.zz
      storage/ndb/test/rqg/spj_test.yy
      storage/ndb/test/src/HugoQueries.cpp
      storage/ndb/test/src/HugoQueryBuilder.cpp
      storage/ndb/test/tools/hugoJoin.cpp
    modified:
      storage/ndb/include/ndbapi/NdbInterpretedCode.hpp
      storage/ndb/include/ndbapi/NdbTransaction.hpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp
      storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
      storage/ndb/src/ndbapi/API.hpp
      storage/ndb/src/ndbapi/CMakeLists.txt
      storage/ndb/src/ndbapi/Makefile.am
      storage/ndb/src/ndbapi/NdbImpl.hpp
      storage/ndb/src/ndbapi/NdbReceiver.cpp
      storage/ndb/src/ndbapi/NdbTransaction.cpp
      storage/ndb/src/ndbapi/NdbTransactionScan.cpp
      storage/ndb/src/ndbapi/Ndberr.cpp
      storage/ndb/src/ndbapi/Ndbif.cpp
      storage/ndb/src/ndbapi/ndberror.c
      storage/ndb/src/ndbapi/ndberror_check.cpp
      storage/ndb/test/ndbapi/CMakeLists.txt
      storage/ndb/test/ndbapi/Makefile.am
      storage/ndb/test/ndbapi/testScan.cpp
      storage/ndb/test/run-test/daily-basic-tests.txt
      storage/ndb/test/src/CMakeLists.txt
      storage/ndb/test/src/Makefile.am
      storage/ndb/test/tools/CMakeLists.txt
      storage/ndb/test/tools/Makefile.am
      storage/ndb/test/tools/hugoLoad.cpp
      storage/ndb/tools/ndbinfo_sql.cpp
=== modified file 'mysql-test/suite/ndb/r/ndb_basic.result'
--- a/mysql-test/suite/ndb/r/ndb_basic.result	2011-03-15 14:55:57 +0000
+++ b/mysql-test/suite/ndb/r/ndb_basic.result	2011-04-14 08:07:33 +0000
@@ -539,6 +539,8 @@ create table t1 ( c512 int, c511 int, c5
 insert into t1 (c1) values (1), (2), (3);
 delete from t1;
 drop table t1;
+create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`);
+ERROR HY000: Field in list of fields for partition function not found in table
 create table t1 (
 a1234567890123456789012345678901234567890 int primary key,
 a12345678901234567890123456789a1234567890 int,

=== modified file 'mysql-test/suite/ndb/t/ndb_basic.test'
--- a/mysql-test/suite/ndb/t/ndb_basic.test	2011-02-04 17:52:38 +0000
+++ b/mysql-test/suite/ndb/t/ndb_basic.test	2011-04-08 13:59:44 +0000
@@ -425,6 +425,13 @@ delete from t1;
 drop table t1;
 
 #
+# test bug#53354 - crash when creating partitioned table with multiple columns in the partition key
+#
+
+--error ER_FIELD_NOT_FOUND_PART_ERROR
+create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`);
+
+#
 # test max size of attribute name and truncation
 #
 

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @@global.slave_exec_mode= 'IDEMPOTENT';
 CREATE TABLE mysql.ndb_apply_status
 ( server_id INT UNSIGNED NOT NULL,
@@ -931,3 +927,4 @@ DELETE FROM t1;
 DROP TABLE IF EXISTS t1;
 set @@global.slave_exec_mode= 'STRICT';
 drop table mysql.ndb_apply_status;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @@global.slave_exec_mode= 'IDEMPOTENT';
 CREATE TABLE mysql.ndb_apply_status
 ( server_id INT UNSIGNED NOT NULL,
@@ -931,3 +927,4 @@ DELETE FROM t1;
 DROP TABLE IF EXISTS t1;
 set @@global.slave_exec_mode= 'STRICT';
 drop table mysql.ndb_apply_status;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result	2010-04-29 14:52:05 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_2ndb.result	2011-04-08 11:06:53 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 SET storage_engine=ndb;
 
 === NDB -> NDB ===
@@ -398,3 +394,4 @@ TRUNCATE TABLE t1;
 TRUNCATE TABLE t1;
 --- Do Cleanup --
 DROP TABLE IF EXISTS t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_add_column.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_add_column.result	2007-11-05 09:30:21 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_add_column.result	2011-03-29 14:09:05 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (c1 INT KEY) ROW_FORMAT=DYNAMIC ENGINE=NDB;
 INSERT INTO t1 VALUES (1),(2),(3);
 ALTER TABLE t1 ADD c2 INT;
@@ -175,3 +171,4 @@ a	b	c	d	e
 1	1	NULL	NULL	NULL
 2	2	NULL	NULL	NULL
 DROP TABLE t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result	2008-10-04 18:49:45 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_apply_status.result	2011-03-29 14:09:05 +0000
@@ -1,10 +1,6 @@
 select * from mysql.ndb_apply_status;
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 *** on slave there should be zero rows ***
 select count(*) from mysql.ndb_apply_status;
 count(*)
@@ -19,3 +15,4 @@ select count(*) from mysql.ndb_apply_sta
 count(*)
 1
 drop table t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result	2009-02-10 16:30:54 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_auto_inc.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 ***************** Test 1 ************************
 
 CREATE TABLE t1 (a INT NOT NULL auto_increment,b INT, PRIMARY KEY (a)) ENGINE=NDB auto_increment=3;
@@ -196,3 +192,4 @@ id
 3
 drop table t1;
 set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE `t1` ( `nid` int(11) NOT NULL default '0',
 `nom` char(4) default NULL,
 `prenom` char(4) default NULL,
@@ -140,7 +136,8 @@ set GLOBAL slave_transaction_retries=1;
 **** On Master ****
 UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
 **** On Slave ****
-Last_SQL_Error = Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: ''. Query: 'COMMIT'
+include/wait_for_slave_sql_error.inc [errno=1205 ]
+Last_SQL_Error = 'Error 'Lock wait timeout exceeded; try restarting transaction' on query. Default database: ''. Query: 'COMMIT''
 set GLOBAL slave_transaction_retries=10;
 include/start_slave.inc
 select * from t1 order by nid;
@@ -230,3 +227,4 @@ select b00 from t1;
 b00
 2
 DROP TABLE t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_bitfield.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_bitfield.result	2010-06-02 09:03:04 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bitfield.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1 ( pk int not null auto_increment primary key, b0 bit(64) not null, b1 bit(64) not null, b2 bit(64) not null, b3
 bit(64) not null, b4 bit(64) not null, b5 bit(64) not null, b6 bit(64) not null, b7 bit(64) not null, b8 bit(64) not null, b9 bit(64) not null, b10
 bit(64) not null, b11 bit(64) not null, b12 bit(64) not null, b13 bit(64) not null, b14 bit(64) not null, b15 bit(64) not null, b16 bit(64),
@@ -83,3 +79,4 @@ pk	hex(b0)	hex(b1)	hex(b2)	hex(b3)	hex(b
 3	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F0	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F0	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	F0F0F0F0F0F0F0F0	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000	FFFFFFFF00000000
 4	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F0	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F0	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF	F0F0F0F0F0F0F0F0	FFFFFFFF	FFFFFFFF	FFFFFFFF	FFFFFFFF
 DROP TABLE t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result	2008-04-09 09:42:01 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_blob.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1 (
 a int not null primary key,
 b text not null
@@ -146,3 +142,4 @@ S	testtttttttttt	t1	8fc937d303ee7e4795c0
 S	testttttttttttt	t1	a5229e9f8977bc99afc3b3627c56f083e97e01bd	21	22	23	24	25
 S	testtttttttttttt	t1	0820e6ad3eeb06ea60e5e04d0bfe36f286b91098	31	32	33	34	35
 drop table t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result	2010-11-08 12:19:51 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_break_3_chain.result	2011-04-08 11:06:53 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 show variables like 'server_id';
 Variable_name	Value
 server_id	1

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_bug22045.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_bug22045.result	2008-04-07 12:27:57 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_bug22045.result	2011-03-29 14:09:05 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1 (a int primary key,
 b varchar(100) default 'b',
 c varchar(100)) engine=ndbcluster;
@@ -102,3 +98,4 @@ a	b	c	d	e
 6	b	NULL	NULL	NULL
 7	b	NULL	NULL	e7x
 drop table t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_check_for_mixed.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_check_for_mixed.result	2009-04-15 02:35:39 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_check_for_mixed.result	2011-04-08 11:06:53 +0000
@@ -1,8 +1,4 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 Variable_name	Value
 binlog_format	MIXED

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2010-11-08 15:37:40 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2011-04-14 08:07:33 +0000
@@ -1,12 +1,6 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-RESET MASTER;
-CHANGE MASTER TO master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
-START SLAVE;
+include/rpl_init.inc [topology=1->2->1]
+include/rpl_connect.inc [creating master]
+include/rpl_connect.inc [creating slave]
 CREATE TABLE t1 (a int key, b int) ENGINE=ndb;
 SHOW TABLES;
 Tables_in_test
@@ -84,12 +78,12 @@ slave-bin.000001	#	Table_map	2	#	table_i
 slave-bin.000001	#	Write_rows	2	#	table_id: #
 slave-bin.000001	#	Write_rows	2	#	table_id: # flags: STMT_END_F
 slave-bin.000001	#	Query	2	#	COMMIT
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
 2	3
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 Master Binlog contains only Master ops as log_slave_updates is off
 show variables like 'server_id';
 Variable_name	Value
@@ -177,3 +171,4 @@ set global ndb_log_apply_status=off;
 stop slave;
 drop table t1;
 drop table t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (a int key, b int) ENGINE=NDB;
 SHOW TABLES;
 Tables_in_test
@@ -12,9 +8,10 @@ RESET MASTER;
 INSERT INTO t1 VALUES (1,2);
 INSERT INTO t1 VALUES (2,3);
 STOP SLAVE;
-CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=SLAVE_PORT,MASTER_USER="root";
+include/rpl_change_topology.inc [new topology=1->2->1]
 START SLAVE;
-Checking that both slave threads are running.
+include/wait_for_slave_to_start.inc
+include/check_slave_is_running.inc
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
@@ -25,5 +22,7 @@ SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
 2	3
-Checking that both slave threads are running.
+include/wait_for_slave_to_start.inc
+include/check_slave_is_running.inc
 DROP TABLE t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict.result	2010-01-27 09:29:10 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 insert into mysql.ndb_replication values ("test", "t1_old", 0, 7, "NDB$OLD(X)");
 insert into mysql.ndb_replication values ("test", "t1_max", 0, 7, "NDB$MAX(X)");
 insert into mysql.ndb_replication values ("test", "t1_max_delete_win", 0, 7, "NDB$MAX_DELETE_WIN(X)");
@@ -73,3 +69,4 @@ delete from t1_max;
 "Cleanup"
 drop table mysql.ndb_replication;
 drop table t1_old, `t1_old$EX`, t1_max, `t1_max$EX`, t1_max_delete_win, `t1_max_delete_win$EX`;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max.result	2010-01-27 09:29:10 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max.result	2011-04-07 21:06:07 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 *** Test 1 ********************************************************
 * test native NDB$MAX() conflict resolution
 * test with both allowed "conflict column" types, uint32 and uint64
@@ -45,8 +41,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -71,8 +67,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -91,8 +87,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -118,8 +114,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -166,8 +162,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -202,8 +198,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -263,8 +259,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -289,8 +285,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -309,8 +305,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -336,8 +332,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -384,8 +380,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -420,8 +416,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -481,8 +477,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -513,8 +509,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -541,8 +537,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -576,8 +572,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -624,11 +620,11 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	1	#	#
-2	1	#	2	#	#
-2	1	#	3	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	5	#	#
+2	1	#	6	#	#
+2	1	#	7	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -666,14 +662,14 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 6
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	1	#	#
-2	1	#	2	#	#
-2	1	#	3	#	#
-2	1	#	4	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	5	#	#
 2	1	#	6	#	#
+2	1	#	7	#	#
+2	1	#	8	#	#
+2	1	#	9	#	#
+2	1	#	10	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -737,8 +733,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -763,8 +759,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -783,8 +779,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -810,8 +806,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -858,9 +854,9 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 1
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	4	111222333
@@ -897,9 +893,9 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 1
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	4	111222333
@@ -918,3 +914,4 @@ a	b	c	d
 3	Master t2 a=3 at c=13	13	111222333
 drop table t1, t2;
 *** test cleanup
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max_delete_win.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max_delete_win.result	2010-01-27 09:29:10 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_max_delete_win.result	2011-04-07 21:06:07 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 *** Test 1 ********************************************************
 * test native NDB$MAX_DELETE_WIN() conflict resolution
 * test with both allowed "conflict column" types, uint32 and uint64
@@ -45,8 +41,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -71,8 +67,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -91,8 +87,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -118,8 +114,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -166,8 +162,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -202,8 +198,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -263,8 +259,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -289,8 +285,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -309,8 +305,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -336,8 +332,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -384,8 +380,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -420,8 +416,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -481,8 +477,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -513,8 +509,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -541,8 +537,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -576,8 +572,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -624,11 +620,11 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	1	#	#
-2	1	#	2	#	#
-2	1	#	3	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	5	#	#
+2	1	#	6	#	#
+2	1	#	7	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -666,14 +662,14 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 6
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	1	#	#
-2	1	#	2	#	#
-2	1	#	3	#	#
-2	1	#	4	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	5	#	#
 2	1	#	6	#	#
+2	1	#	7	#	#
+2	1	#	8	#	#
+2	1	#	9	#	#
+2	1	#	10	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -737,8 +733,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -763,8 +759,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -783,8 +779,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -810,8 +806,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -858,8 +854,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -894,8 +890,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -913,3 +909,4 @@ a	b	c	d
 3	Master t2 a=3 at c=13	13	111222333
 drop table t1, t2;
 *** test cleanup
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_old.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_old.result	2010-01-27 09:29:10 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_conflict_old.result	2011-04-07 21:06:07 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 *** Test 1 ********************************************************
 * test native NDB$OLD() conflict resolution
 * test with both allowed "conflict column" types, uint32 and uint64
@@ -45,8 +41,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -71,8 +67,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -91,8 +87,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -118,8 +114,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -166,8 +162,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -208,8 +204,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 5
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 2	1	#	1	#	#
 2	1	#	2	#	#
 2	1	#	3	#	#
@@ -279,8 +275,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -305,8 +301,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -325,8 +321,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -352,8 +348,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -400,11 +396,11 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-4	#	#
-2	1	#	-3	#	#
-2	1	#	-2	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -442,13 +438,13 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 5
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-4	#	#
-2	1	#	-3	#	#
-2	1	#	-2	#	#
-2	1	#	-1	#	#
-2	1	#	0	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
+2	1	#	4	#	#
+2	1	#	5	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -513,11 +509,11 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
-2	1	#	-8	#	#
-2	1	#	-7	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	1
@@ -545,12 +541,12 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
-2	1	#	-8	#	#
-2	1	#	-7	#	#
-2	1	#	-6	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
+2	1	#	4	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	1
@@ -573,12 +569,12 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
-2	1	#	-8	#	#
-2	1	#	-7	#	#
-2	1	#	-6	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
+2	1	#	4	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	1
@@ -608,8 +604,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -656,11 +652,11 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 3
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
-2	1	#	-8	#	#
-2	1	#	-7	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	5	#	#
+2	1	#	6	#	#
+2	1	#	7	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -698,14 +694,14 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 6
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-9	#	#
-2	1	#	-8	#	#
-2	1	#	-7	#	#
-2	1	#	-6	#	#
-2	1	#	-5	#	#
-2	1	#	-4	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	5	#	#
+2	1	#	6	#	#
+2	1	#	7	#	#
+2	1	#	8	#	#
+2	1	#	9	#	#
+2	1	#	10	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -769,8 +765,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -795,8 +791,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -815,8 +811,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -842,8 +838,8 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 0
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 SELECT * FROM `t2$EX` ORDER BY server_id, master_server_id, master_epoch, count;
@@ -890,12 +886,12 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 4
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-19	#	#
-2	1	#	-18	#	#
-2	1	#	-17	#	#
-2	1	#	-16	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
+2	1	#	4	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -935,14 +931,14 @@ VARIABLE_VALUE-@init_ndb_conflict_fn_max
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 VARIABLE_VALUE-@init_ndb_conflict_fn_old
 6
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
-server_id	master_server_id	master_epoch	count-@init_ndb_conflict_fn_old	a	d
-2	1	#	-19	#	#
-2	1	#	-18	#	#
-2	1	#	-17	#	#
-2	1	#	-16	#	#
-2	1	#	-15	#	#
-2	1	#	-14	#	#
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+server_id	master_server_id	master_epoch	count	a	d
+2	1	#	1	#	#
+2	1	#	2	#	#
+2	1	#	3	#	#
+2	1	#	4	#	#
+2	1	#	5	#	#
+2	1	#	6	#	#
 SELECT * FROM `t1$EX` ORDER BY a, d;
 server_id	master_server_id	master_epoch	count	a	d
 2	1	#	#	1	111
@@ -966,3 +962,4 @@ a	b	c	d
 3	Master t2 a=3 at c=13	13	111222333
 drop table t1, t2;
 *** test cleanup
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_advance.result	2011-04-08 11:06:53 +0000
@@ -1,10 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
-DROP TABLE IF EXISTS t1, t2, t3;
+include/master-slave.inc
+[connection master]
 ***** Test 1 RPL of CDD and Alter *****
 ***** Test 1 setup *****
 CREATE LOGFILE GROUP lg1
@@ -322,3 +317,4 @@ ENGINE=NDB;
 DROP TABLESPACE ts2 ENGINE=NDB;
 DROP LOGFILE GROUP lg1 ENGINE=NDB;
 ****** Do dumps compare ************
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 --- Doing pre test cleanup --- 
 DROP TABLE IF EXISTS t1;
 CREATE LOGFILE GROUP lg1
@@ -800,3 +796,4 @@ drop datafile 'datafile02.dat'
 engine=ndb;
 DROP TABLESPACE ts1 ENGINE=NDB;
 DROP LOGFILE GROUP lg1 ENGINE=NDB;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result	2011-01-26 09:54:24 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ddl.result	2011-04-14 08:07:33 +0000
@@ -1,15 +1,8 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 
 -------- switch to master -------
 SET AUTOCOMMIT = 1;
-DROP DATABASE IF EXISTS mysqltest1;
-DROP DATABASE IF EXISTS mysqltest2;
-DROP DATABASE IF EXISTS mysqltest3;
 CREATE DATABASE mysqltest1;
 CREATE DATABASE mysqltest2;
 CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=NDB;
@@ -1626,3 +1619,4 @@ use test;
 -------- switch to master -------
 DROP DATABASE mysqltest1;
 DROP DATABASE mysqltest3;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_empty_epoch.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_empty_epoch.result	2010-03-22 14:17:13 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_empty_epoch.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (
 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
 c1 VARCHAR(30),
@@ -32,3 +28,4 @@ COUNT(epoch) > 0
 1
 set global ndb_log_empty_epochs = @old_ndb_log_empty_epochs;
 DROP TABLE IF EXISTS t1,t2;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051");
 **** Diff Table Def Start ****
 *** On Slave ***
@@ -57,6 +53,7 @@ a	b	c
 3	4	QA TESTING
 *** Start Slave ***
 START SLAVE;
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -127,6 +124,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TE
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -192,6 +190,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle,
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -257,6 +256,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -321,6 +321,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -433,13 +434,13 @@ START SLAVE;
 set @b1 = 'b1b1b1b1';
 set @b1 = concat(@b1,@b1);
 INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
-Last_SQL_Errno=0
+include/wait_for_slave_sql_to_stop.inc
+Last_SQL_Errno=1032
 Last_SQL_Error
-
+Error 'Can't find record in 't9'' on query. Default database: ''. Query: 'COMMIT'
 STOP SLAVE;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
-*** Drop t9  ***
 DROP TABLE t9;
 *** Create t10 on slave  ***
 STOP SLAVE;
@@ -459,6 +460,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -523,6 +525,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -723,6 +726,7 @@ c1	c4	c5	c6	c7
 4	b1b1b1b1b1b1b1b1	NULL	1	CURRENT_TIMESTAMP
 5	b1b1b1b1b1b1b1b1	NULL	1	CURRENT_TIMESTAMP
 6	b1b1b1b1b1b1b1b1	NULL	1	CURRENT_TIMESTAMP
+DROP TABLE t14a;
 *** connect to master and drop columns ***
 ALTER TABLE t14 DROP COLUMN c2;
 ALTER TABLE t14 DROP COLUMN c4;
@@ -776,6 +780,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER 
 ********************************************
 *** Expect slave to fail with Error 1060 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -919,6 +924,7 @@ INSERT INTO t17 () VALUES(92233720368547
 ********************************************
 *** Expect slave to fail with Error 1522 ***
 ********************************************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -965,3 +971,4 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 ** DROP table t17 ***
 DROP TABLE t17;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraColMaster.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set binlog_format=row;
 
 ***********************************************************
@@ -550,6 +546,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,
 *** Expect slave to fail with Error 1523 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -628,6 +625,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing
 *** Expect slave to fail with Error 1523 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -782,6 +780,7 @@ c1	c3	hex(c4)	c5	c6
 ************
 * Bug30415 *
 ************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -871,6 +870,7 @@ c1	hex(c4)	c5	c6	c7	c2
 *** Expect slave to fail with Error 1054 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -960,6 +960,7 @@ c1	hex(c4)	c5	c6	c7
 *** BUG 30434 ***
 *****************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -1165,7 +1166,6 @@ c1	hex(c4)	c5
 2	6231623162316231	JOE
 3	6231623162316231	QA
 DROP TABLE t5;
-
 set binlog_format=mixed;
 
 ***********************************************************
@@ -1712,6 +1712,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,
 *** Expect slave to fail with Error 1523 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -1790,6 +1791,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing
 *** Expect slave to fail with Error 1523 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -1944,6 +1946,7 @@ c1	c3	hex(c4)	c5	c6
 ************
 * Bug30415 *
 ************
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -2033,6 +2036,7 @@ c1	hex(c4)	c5	c6	c7	c2
 *** Expect slave to fail with Error 1054 ***
 ********************************************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -2122,6 +2126,7 @@ c1	hex(c4)	c5	c6	c7
 *** BUG 30434 ***
 *****************
 
+include/wait_for_slave_sql_to_stop.inc
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -2327,4 +2332,4 @@ c1	hex(c4)	c5
 2	6231623162316231	JOE
 3	6231623162316231	QA
 DROP TABLE t5;
-
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_gap_event.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_gap_event.result	2011-03-14 21:42:25 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_gap_event.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1(pk int not null primary key, i int) engine = ndb;
 select count(*) from t1;
 count(*)
@@ -15,8 +11,12 @@ master-bin.000002	#	Incident	1	<end_pos>
 drop table if exists t1;
 Get IO thread to reconnect to Master
 start slave;
-Slave_IO_Running	Yes
-Slave_SQL_Running	No
-Last_Errno	1590
-Last_Error	The incident LOST_EVENTS occured on the master. Message: mysqld startup
+include/wait_for_slave_sql_error.inc [errno=1590]
+Last_SQL_Error = 'The incident LOST_EVENTS occured on the master. Message: mysqld startup'
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'No'
+Last_Errno = '1590'
+Last_Error = 'The incident LOST_EVENTS occured on the master. Message: mysqld startup'
 drop table if exists t1;
+include/stop_slave_io.inc
+RESET SLAVE;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
 INSERT INTO t1 VALUES ("row1","will go away",1);
 SELECT * FROM t1 ORDER BY c3;
@@ -28,11 +24,12 @@ SELECT * FROM t1 ORDER BY c3;
 c1	c2	c3
 row3	C	3
 row4	D	4
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 STOP SLAVE;
 CHANGE MASTER TO
 master_log_file = 'master-bin.000001',
 master_log_pos = <the_pos> ;
+include/check_slave_no_error.inc
 START SLAVE;
 SELECT * FROM t1 ORDER BY c3;
 c1	c2	c3
@@ -58,5 +55,6 @@ COMMIT;
 SELECT * FROM t1;
 c1	c2	c3
 row2	new on slave	2
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 DROP TABLE IF EXISTS t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_ignore_db.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_ignore_db.result	2011-03-14 23:28:51 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_ignore_db.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 delete from mysql.ndb_apply_status;
 use mysql;
 create table t1 (a int primary key, b int) engine=myisam;
@@ -31,3 +27,4 @@ drop table t1;
 drop table t2;
 use test;
 drop table t3;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result	2009-05-15 14:00:51 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result	2011-03-29 14:09:05 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 SET storage_engine=innodb;
 --- Doing pre test cleanup --- 
 DROP TABLE IF EXISTS t1;
@@ -922,3 +918,4 @@ DELETE FROM t1;
 --- End test 5 key partition testing ---
 --- Do Cleanup ---
 DROP TABLE IF EXISTS t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_insert_ignore.result	2011-04-08 12:48:50 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (
 a int unsigned not null auto_increment primary key,
 b int unsigned,
@@ -24,47 +20,10 @@ INSERT INTO t2 VALUES (4, 3);
 INSERT INTO t2 VALUES (5, 4);
 INSERT INTO t2 VALUES (6, 6);
 INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a	b
-1	1
-2	2
-3	3
-4	4
-5	5
-6	6
-SELECT * FROM t1 ORDER BY a;
-a	b
-1	1
-2	2
-3	3
-4	4
-5	5
-6	6
-drop table t1;
-CREATE TABLE t1 (
-a int unsigned not null auto_increment primary key,
-b int unsigned,
-unique (b)
-) ENGINE=myisam;
-INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 VALUES (2, 2);
-INSERT INTO t1 VALUES (3, 3);
-INSERT INTO t1 VALUES (4, 4);
+include/assert.inc [Count of elements in t1 should be 6.]
+include/diff_tables.inc [master:test.t1 , slave:test.t1]
 INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
-SELECT * FROM t1 ORDER BY a;
-a	b
-1	1
-2	2
-3	3
-4	4
-5	5
-6	6
-SELECT * FROM t1 ORDER BY a;
-a	b
-1	1
-2	2
-3	3
-4	4
-5	5
-6	6
+include/assert.inc [Count of elements in t1 should be 6.]
+include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
 drop table t1, t2;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_logging.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_logging.result	2009-02-16 22:16:44 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_logging.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 **** Test 1 ****
 delete from mysql.ndb_replication;
 insert into mysql.ndb_replication values ("test", "t1", 0, 1, NULL);
@@ -71,3 +67,4 @@ a	b	c
 drop table t1;
 drop table t2;
 drop table mysql.ndb_replication;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mix_innodb.result	2011-04-08 11:06:53 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 
 *** Test 1 ***
 
@@ -122,12 +118,7 @@ master-bin.000002	#	Xid	1	<end_pos>	COMM
 
 ** Test 4 **
 
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/rpl_reset.inc
 
 select @log_name:=log_name, @start_pos:=start_pos, @end_pos:=end_pos
 from mysql.ndb_apply_status;
@@ -141,3 +132,4 @@ master-bin.000001	#	Xid	1	<end_pos>	COMM
 *** DUMP MASTER & SLAVE FOR COMPARE ********
 DROP DATABASE tpcb;
 ****** Do dumps compare ************
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_multi.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc [rpl_server_count=3]
+[connection master]
 CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
 CREATE TABLE t2 (a int key) ENGINE = NDB ;
 reset master;
@@ -38,11 +34,8 @@ master-bin.000001	#	Query	3	#	COMMIT
 set SQL_LOG_BIN=1;
 @the_pos:=Position	@the_file:=SUBSTRING_INDEX(REPLACE(FILE,'\\','/'), '/', -1)
 107	master-bin.000001
-CHANGE MASTER TO
-master_port=<MASTER_PORT1>,
-master_log_file = 'MASTER_LOG_FILE',
-master_log_pos = MASTER_LOG_POS ;
-start slave;
+include/rpl_change_topology.inc [new topology=3->2]
+include/start_slave.inc
 INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
 DELETE FROM t1 WHERE c3 = 1;
 UPDATE t1 SET c2="should go away" WHERE c3 = 2;
@@ -66,4 +59,4 @@ row5	E	5
 ==== clean up ====
 DROP TABLE t1;
 DROP TABLE t2;
-STOP SLAVE;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result	2009-05-15 14:00:51 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result	2011-03-29 14:09:05 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 SET storage_engine=myisam;
 --- Doing pre test cleanup --- 
 DROP TABLE IF EXISTS t1;
@@ -922,3 +918,4 @@ DELETE FROM t1;
 --- End test 5 key partition testing ---
 --- Do Cleanup ---
 DROP TABLE IF EXISTS t1;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_error.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_error.result	2009-09-24 11:05:08 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_rep_error.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1 (a int key, X int) engine ndb;
 Warnings:
 Error	1626	Bad schema for mysql.ndb_replication table. Message: Wrong number of primary key parts, expected 3

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_skip_gap_event.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_skip_gap_event.result	2011-03-15 00:43:19 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_skip_gap_event.result	2011-04-08 07:03:27 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 create table t1(pk int not null primary key, i int) engine = ndb;
 select count(*) from t1;
 count(*)
@@ -15,14 +11,14 @@ master-bin.000002	#	Incident	1	<end_pos>
 start slave;
 Sync Slave with master
 Show that Slave has not stopped (has skipped GAP)
-Slave_IO_Running	Yes
-Slave_SQL_Running	Yes
-Last_Errno	0
-Last_Error	
+Slave_IO_Running = 'Yes'
+Slave_SQL_Running = 'Yes'
+Last_Errno = '0'
+Last_Error = ''
 Show that replication can continue
 insert into t1 values (1001, 1001);
 select count(*) from t1;
 count(*)
 1001
-drop table if exists t1;
 drop table t1;
+include/stop_slave.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu.result	2010-07-02 17:10:16 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu.result	2011-04-08 11:06:53 +0000
@@ -1,10 +1,10 @@
 *** Configuring connections ***
-STOP SLAVE;
 *** Waiting for each cluster to startup ***
 *** Configuring replication via Slave ***
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";;
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -398,10 +398,11 @@ server id 6    	Query	 	 	 
 server id 1    	Query	 	 	 
 *** Configuring replication via Slave1 ***
 STOP SLAVE;
-STOP SLAVE;
+include/wait_for_slave_to_stop.inc
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -795,10 +796,11 @@ server id 6    	Query	 	 	 
 server id 1    	Query	 	 	 
 *** Configuring replication via Slave2 ***
 STOP SLAVE;
-STOP SLAVE;
+include/wait_for_slave_to_stop.inc
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";;
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -1190,3 +1192,14 @@ server id 6    	Write_rows:  
 server id 1    	Write_rows:   flags: STMT_END_F
 server id 6    	Query	 	 	 
 server id 1    	Query	 	 	 
+"cleanup srv_slave"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+"cleanup srv_slave1"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+"cleanup srv_slave2"
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu_anyval.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu_anyval.result	2010-07-02 17:10:16 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_lsu_anyval.result	2011-04-08 11:06:53 +0000
@@ -1,10 +1,10 @@
 *** Configuring connections ***
-STOP SLAVE;
 *** Waiting for each cluster to startup ***
 *** Configuring replication via Slave ***
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";;
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -398,10 +398,11 @@ server id 6    	Query	 	 	 
 server id 2147483521    	Query	 	 	 
 *** Configuring replication via Slave1 ***
 STOP SLAVE;
-STOP SLAVE;
+include/wait_for_slave_to_stop.inc
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -795,10 +796,11 @@ server id 6    	Query	 	 	 
 server id 2147483521    	Query	 	 	 
 *** Configuring replication via Slave2 ***
 STOP SLAVE;
-STOP SLAVE;
+include/wait_for_slave_to_stop.inc
 RESET SLAVE;
 CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=MASTER_PORT,MASTER_USER="root";;
 START SLAVE;
+include/wait_for_slave_to_start.inc
 *** Generating slave cluster originated binloggable changes ***
 CREATE TABLE bug_45756_slave_logged_1 (a int) engine = NDB;
 INSERT INTO bug_45756_slave_logged_1 VALUES (1);
@@ -1190,3 +1192,14 @@ server id 6    	Write_rows:  
 server id 2147483521    	Write_rows:   flags: STMT_END_F
 server id 6    	Query	 	 	 
 server id 1    	Query	 	 	 
+"cleanup srv_slave"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+"cleanup srv_slave1"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+"cleanup srv_slave2"
+STOP SLAVE;
+include/wait_for_slave_to_stop.inc
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_restart.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_restart.result	2010-05-10 06:24:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_slave_restart.result	2011-04-08 12:52:26 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (c1 CHAR(15), c2 CHAR(15), c3 INT, PRIMARY KEY (c3)) ENGINE = NDB ;
 CREATE TABLE t2 (a int key) ENGINE = NDB ;
 reset master;
@@ -67,3 +63,5 @@ row5	E	5
 DROP TABLE t1;
 DROP TABLE t2;
 STOP SLAVE;
+CHANGE MASTER TO
+master_port=<MASTER_PORT>;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 STOP SLAVE;
 CREATE DATABASE ndbsynctest;
 USE ndbsynctest;
@@ -62,7 +58,7 @@ CHANGE MASTER TO
 master_log_file = 'master-bin.000001',
 master_log_pos = <the_pos> ;
 START SLAVE;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
 hex(c1)	hex(c2)	c3
 1	1	row1
@@ -83,3 +79,4 @@ Position	File	epoch	inserts	updates	dele
 reset slave;
 select * from mysql.ndb_apply_status;
 server_id	epoch	log_name	start_pos	end_pos
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result	2010-02-19 10:39:15 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_all.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @saved_slave_type_conversions = @@global.slave_type_conversions;
 CREATE TABLE type_conversions (
 TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,11 +37,7 @@ SELECT @@global.slave_type_conversions;
 ALL_LOSSY,ALL_NON_LOSSY
 SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
 **** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
 **** Result of conversions ****
 Source_Type	Target_Type	All_Type_Conversion_Flags	Value_On_Slave
 GEOMETRY       	GEOMETRY       	ALL_LOSSY,ALL_NON_LOSSY  	<Correct value>
@@ -154,3 +146,4 @@ BIT(12)        	BIT(5)         	ALL_LOSS
 DROP TABLE type_conversions;
 DROP TABLE t1;
 set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result	2010-02-19 10:39:15 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_lossy.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @saved_slave_type_conversions = @@global.slave_type_conversions;
 CREATE TABLE type_conversions (
 TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,11 +37,7 @@ SELECT @@global.slave_type_conversions;
 ALL_LOSSY,ALL_NON_LOSSY
 SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
 **** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
 **** Result of conversions ****
 Source_Type	Target_Type	All_Type_Conversion_Flags	Value_On_Slave
 GEOMETRY       	GEOMETRY       	ALL_LOSSY                	<Correct value>
@@ -154,3 +146,4 @@ BIT(12)        	BIT(5)         	ALL_LOSS
 DROP TABLE type_conversions;
 DROP TABLE t1;
 set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result	2010-02-19 10:39:15 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_nonlossy.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @saved_slave_type_conversions = @@global.slave_type_conversions;
 CREATE TABLE type_conversions (
 TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,11 +37,7 @@ SELECT @@global.slave_type_conversions;
 ALL_LOSSY,ALL_NON_LOSSY
 SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
 **** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
 **** Result of conversions ****
 Source_Type	Target_Type	All_Type_Conversion_Flags	Value_On_Slave
 GEOMETRY       	GEOMETRY       	ALL_NON_LOSSY            	<Correct value>
@@ -154,3 +146,4 @@ BIT(12)        	BIT(5)         	ALL_NON_
 DROP TABLE type_conversions;
 DROP TABLE t1;
 set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result	2010-02-19 10:39:15 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_typeconv_strict.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 set @saved_slave_type_conversions = @@global.slave_type_conversions;
 CREATE TABLE type_conversions (
 TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -41,11 +37,7 @@ SELECT @@global.slave_type_conversions;
 ALL_LOSSY,ALL_NON_LOSSY
 SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
 **** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
 **** Result of conversions ****
 Source_Type	Target_Type	All_Type_Conversion_Flags	Value_On_Slave
 GEOMETRY       	GEOMETRY       	                         	<Correct value>
@@ -154,3 +146,4 @@ BIT(12)        	BIT(5)         	        
 DROP TABLE type_conversions;
 DROP TABLE t1;
 set global slave_type_conversions = @saved_slave_type_conversions;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result	2011-04-14 08:07:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'NDB'  ;
 SELECT * FROM t1;
 C1	C2
@@ -422,11 +418,7 @@ a	b	c
 **** Test for BUG#31552 ****
 **** On Master ****
 DELETE FROM t1;
-**** Resetting master and slave ****
-include/stop_slave.inc
-RESET SLAVE;
-RESET MASTER;
-include/start_slave.inc
+include/rpl_reset.inc
 **** On Master ****
 INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
 **** On Master ****
@@ -436,7 +428,7 @@ DELETE FROM t1;
 SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 COUNT(*)	0
 set @@global.slave_exec_mode= default;
-Checking that both slave threads are running.
+include/check_slave_is_running.inc
 SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
 COUNT(*)	0
 **** Test for BUG#37076 ****
@@ -480,48 +472,44 @@ SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL
 [expecting slave to replicate correctly]
 INSERT INTO t1 VALUES (1, "", 1);
 INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
 [expecting slave to replicate correctly]
 INSERT INTO t2 VALUES (1, "", 1);
 INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
-Comparing tables master:test.t2 and slave:test.t2
+include/diff_tables.inc [master:t2, slave:t2]
 [expecting slave to stop]
 INSERT INTO t3 VALUES (1, "", 1);
 INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1642]
+Last_SQL_Error = 'Column 1 of table 'test.t3' cannot be converted from type 'char(128)' to type 'char(16)''
+include/rpl_reset.inc
 [expecting slave to replicate correctly]
 INSERT INTO t4 VALUES (1, "", 1);
 INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
-Comparing tables master:test.t4 and slave:test.t4
+include/diff_tables.inc [master:t4, slave:t4]
 [expecting slave to stop]
 INSERT INTO t5 VALUES (1, "", 1);
 INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1642 ]
+Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
+include/rpl_reset.inc
 [expecting slave to stop]
 INSERT INTO t6 VALUES (1, "", 1);
 INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
-Last_SQL_Error = Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)'
-RESET MASTER;
-STOP SLAVE;
-RESET SLAVE;
-START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1642 ]
+Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
+include/rpl_reset.inc
 [expecting slave to replicate correctly]
 INSERT INTO t7 VALUES (1, "", 1);
 INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
-Comparing tables master:test.t7 and slave:test.t7
+include/diff_tables.inc [master:t7, slave:t7]
 drop table t1, t2, t3, t4, t5, t6, t7;
 CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='NDB' ;
 INSERT INTO t1 VALUES (1), (2), (3);
 UPDATE t1 SET a = 10;
 ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
 INSERT INTO t1 VALUES (4);
-Comparing tables master:test.t1 and slave:test.t1
+include/diff_tables.inc [master:t1, slave:t1]
 drop table t1;
 SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result	2010-10-12 11:54:35 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result	2011-04-07 19:57:33 +0000
@@ -1,9 +1,5 @@
-stop slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-reset master;
-reset slave;
-drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-start slave;
+include/master-slave.inc
+[connection master]
 **** On Master ****
 CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
 INSERT INTO t1 VALUES (1,1), (2,2);
@@ -87,3 +83,4 @@ master-bin.000001	#	Write_rows	#	#	table
 master-bin.000001	#	Delete_rows	#	#	table_id: # flags: STMT_END_F
 master-bin.000001	#	Query	#	#	COMMIT
 master-bin.000001	#	Query	#	#	use `test`; DROP TABLE t1
+include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/ndb_conflict_info.inc'
--- a/mysql-test/suite/rpl_ndb/t/ndb_conflict_info.inc	2011-03-16 11:07:13 +0000
+++ b/mysql-test/suite/rpl_ndb/t/ndb_conflict_info.inc	2011-04-06 13:50:30 +0000
@@ -2,7 +2,7 @@ SELECT VARIABLE_VALUE-@init_ndb_conflict
 SELECT VARIABLE_VALUE-@init_ndb_conflict_fn_old FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE "NDB_CONFLICT_FN_OLD";
 --replace_column 3 # 5 # 6 #
 --error 0,1146
-SELECT server_id, master_server_id, master_epoch, count-@init_ndb_conflict_fn_old, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
+SELECT server_id, master_server_id, master_epoch, count, a, d FROM `t1$EX` ORDER BY server_id, master_server_id, master_epoch, count;
 --replace_column 3 # 4 #
 --error 0,1146
 SELECT * FROM `t1$EX` ORDER BY a, d;

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test	2011-04-14 08:07:33 +0000
@@ -47,3 +47,4 @@ set storage_engine=ndbcluster;
 --connection slave
 set @@global.slave_exec_mode= 'STRICT';
 drop table mysql.ndb_apply_status;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test	2011-04-14 08:07:33 +0000
@@ -46,3 +46,4 @@ set storage_engine=ndbcluster;
 --connection slave
 set @@global.slave_exec_mode= 'STRICT';
 drop table mysql.ndb_apply_status;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2ndb.test	2011-04-08 11:06:53 +0000
@@ -17,3 +17,4 @@ SET storage_engine=ndb;
 --echo
 connection slave;
 --source extra/rpl_tests/rpl_ndb_2multi_basic.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test	2011-04-08 11:06:53 +0000
@@ -6,3 +6,4 @@
 --source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 --source extra/rpl_tests/rpl_row_UUID.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_add_column.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_add_column.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_add_column.test	2011-04-08 11:06:53 +0000
@@ -115,4 +115,4 @@ SELECT * FROM t1 ORDER BY a;
 # cleanup
 --connection master
 DROP TABLE t1;
--- source include/master-slave-end.inc
+-- source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test	2010-10-28 06:47:47 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_apply_status.test	2011-04-08 11:06:53 +0000
@@ -42,3 +42,4 @@ select count(*) from mysql.ndb_apply_sta
 connection master;
 drop table t1;
 sync_slave_with_master;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_auto_inc.test	2011-04-08 11:06:53 +0000
@@ -134,3 +134,4 @@ drop table t1;
 set ndb_autoincrement_prefetch_sz = @old_ndb_autoincrement_prefetch_sz;
 # End cleanup
 sync_slave_with_master;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test	2011-04-08 11:06:53 +0000
@@ -179,3 +179,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/master_
 
   --dec $2
 }
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test	2011-04-14 08:07:33 +0000
@@ -192,7 +192,6 @@ UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1
 # Wait for deadlock to be detected.
 # When detected, the slave will stop, so we just wait for it to stop.
 connection slave;
-source include/wait_for_slave_sql_to_stop.inc;
 
 # Replication should have stopped, since max retries were not enough.
 # verify with show slave status
@@ -301,4 +300,4 @@ select b00 from t1;
 --connection master
 DROP TABLE t1;
 
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_bitfield.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bitfield.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bitfield.test	2011-04-08 11:06:53 +0000
@@ -86,4 +86,4 @@ hex(b50),hex(b51),hex(b52),hex(b53),hex(
 --connection master
 DROP TABLE t1;
 
--- source include/master-slave-end.inc
+-- source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test	2011-04-14 08:07:33 +0000
@@ -153,3 +153,4 @@ drop table t1;
 #let $VERSION=`select version()`;
 #--replace_result $VERSION VERSION
 #show binlog events;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test	2011-04-14 08:07:33 +0000
@@ -8,3 +8,4 @@
 let $engine_type=NDBCLUSTER;
 -- source extra/rpl_tests/rpl_row_blob.test
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_bug22045.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_bug22045.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_bug22045.test	2011-04-08 11:06:53 +0000
@@ -66,4 +66,4 @@ select * from t1 order by a;
 --connection master
 drop table t1;
 
--- source include/master-slave-end.inc
+-- source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test	2010-11-08 15:37:40 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test	2011-04-14 08:07:33 +0000
@@ -1,15 +1,16 @@
 --source include/have_ndb.inc
---source suite/rpl_ndb/ndb_master-slave.inc
 
 # set up circular replication
+--let $rpl_topology= 1->2->1
+--source include/rpl_init.inc
 
---connection slave
-RESET MASTER;
-
---connection master
---replace_result $SLAVE_MYPORT SLAVE_PORT
---eval CHANGE MASTER TO master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root"
-START SLAVE;
+--let $rpl_connection_name= master
+--let $rpl_server_number= 1
+--source include/rpl_connect.inc
+
+--let $rpl_connection_name= slave
+--let $rpl_server_number= 2
+--source include/rpl_connect.inc
 
 
 # create the table on the "slave"
@@ -148,3 +149,6 @@ drop table t1;
 --connection master
 
 drop table t1;
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf	2011-04-14 08:07:33 +0000
@@ -26,15 +26,7 @@ skip-slave-start
 
 [mysqld.2.slave]
 server-id= 2
-master-host=		127.0.0.1
-master-port=		@mysqld.2.1.port
-master-password=	@mysqld.2.1.#password
-master-user=		@mysqld.2.1.#user
-master-connect-retry=	1
-init-rpl-role=		slave
 log-bin
-log-slave-updates
-skip-slave-start
 ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
 
 [ENV]

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.test	2011-04-08 11:06:53 +0000
@@ -75,9 +75,7 @@ let $wait_condition= SELECT COUNT(*)=40 
 
 # Check data
 --echo Check data on both clusters 
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
+let $diff_tables= master:t1, slave:t1;
 source include/diff_tables.inc;
 
 --echo *** Transaction testing ***
@@ -116,9 +114,7 @@ let $wait_condition= SELECT COUNT(*)=400
 --source include/wait_condition.inc
 
 --echo Check data on both clusters 
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
+let $diff_tables= master:t1, slave:t1;
 source include/diff_tables.inc;
 
 # Start transaction and then roll back
@@ -155,18 +151,17 @@ let $wait_condition= SELECT COUNT(*)=200
 --source include/wait_condition.inc
 
 --echo Check data on both clusters 
-let $diff_table_1=master:test.t1;
-let $diff_table_2=slave:test.t1;
-
+let $diff_tables= master:t1, slave:t1;
 source include/diff_tables.inc;
 
 # Clean up
 --connection master
-DROP TABLE t1;
---connection slave
---disable_warnings
 DROP TABLE IF EXISTS t1;
---enable_warnings
+--connection slave
+# Wait until table is dropped on slave.
+--let $query= SELECT COUNT(*) FROM t1
+--source include/wait_for_query_to_fail.inc
 --echo
 
 # End of test 5.1
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test	2011-04-14 08:07:33 +0000
@@ -31,9 +31,9 @@ INSERT INTO t1 VALUES (2,3);
 # Replicate back to the master to test this mixed event on the master
 STOP SLAVE;
 
+--let $rpl_topology= 1->2->1
+--source include/rpl_change_topology.inc
 connection master;
---replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CHANGE MASTER TO MASTER_HOST="127.0.0.1",MASTER_PORT=$SLAVE_MYPORT,MASTER_USER="root";
 
 START SLAVE;
 
@@ -82,3 +82,6 @@ source include/check_slave_is_running.in
 -- connection master
 DROP TABLE t1;
 -- sync_slave_with_master
+
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test	2011-04-14 08:07:33 +0000
@@ -8,3 +8,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_commit_after_flush.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict.test	2011-04-08 11:06:53 +0000
@@ -6,10 +6,8 @@
 --source include/have_binlog_format_mixed_or_row.inc
 --source suite/rpl_ndb/ndb_master-slave.inc
 
---disable_warnings
 --disable_query_log
 --connection master
-drop table if exists mysql.ndb_replication;
 CREATE TABLE mysql.ndb_replication
   (db VARBINARY(63),
    table_name VARBINARY(63),
@@ -18,14 +16,6 @@ CREATE TABLE mysql.ndb_replication
    conflict_fn VARBINARY(128),
    PRIMARY KEY USING HASH (db,table_name,server_id))
   ENGINE=NDB PARTITION BY KEY(db,table_name);
-
-drop table if exists t1_old;
-drop table if exists `test`.`t1_old$EX`;
-drop table if exists t1_max;
-drop table if exists `test`.`t1_max$EX`;
-drop table if exists t1_max_delete_win;
-drop table if exists `test`.`t1_max_delete_win$EX`;
---enable_warnings
 --enable_query_log
 
 # only test with binlog_type = 7, as everything else feels insane in context of conflict resolution
@@ -123,3 +113,5 @@ delete from t1_max;
 drop table mysql.ndb_replication;
 drop table t1_old, `t1_old$EX`, t1_max, `t1_max$EX`, t1_max_delete_win, `t1_max_delete_win$EX`;
 --sync_slave_with_master
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max.test	2011-04-08 11:06:53 +0000
@@ -6,10 +6,8 @@
 --source include/have_binlog_format_mixed_or_row.inc
 --source suite/rpl_ndb/ndb_master-slave.inc
 
---disable_warnings
 --disable_query_log
 --connection master
-drop table if exists mysql.ndb_replication;
 CREATE TABLE mysql.ndb_replication
   (db VARBINARY(63),
    table_name VARBINARY(63),
@@ -18,8 +16,6 @@ CREATE TABLE mysql.ndb_replication
    conflict_fn VARBINARY(128),
    PRIMARY KEY USING HASH (db,table_name,server_id))
   ENGINE=NDB PARTITION BY KEY(db,table_name);
-drop table if exists `test`.`t1$EX`;
-drop table if exists `test`.`t2$EX`;
 create table `test`.`t1$EX`
   (server_id int unsigned,
    master_server_id int unsigned,
@@ -28,7 +24,6 @@ create table `test`.`t1$EX`
    a int not null,
    d varchar(9) not null,
    primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
---enable_warnings
 --enable_query_log
 
 --echo *** Test 1 ********************************************************
@@ -78,3 +73,5 @@ drop table mysql.ndb_replication;
 drop table `test`.`t1$EX`;
 --sync_slave_with_master
 --enable_query_log
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max_delete_win.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max_delete_win.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_max_delete_win.test	2011-04-08 11:06:53 +0000
@@ -6,10 +6,8 @@
 --source include/have_binlog_format_mixed_or_row.inc
 --source suite/rpl_ndb/ndb_master-slave.inc
 
---disable_warnings
 --disable_query_log
 --connection master
-drop table if exists mysql.ndb_replication;
 CREATE TABLE mysql.ndb_replication
   (db VARBINARY(63),
    table_name VARBINARY(63),
@@ -18,8 +16,6 @@ CREATE TABLE mysql.ndb_replication
    conflict_fn VARBINARY(128),
    PRIMARY KEY USING HASH (db,table_name,server_id))
   ENGINE=NDB PARTITION BY KEY(db,table_name);
-drop table if exists `test`.`t1$EX`;
-drop table if exists `test`.`t2$EX`;
 create table `test`.`t1$EX`
   (server_id int unsigned,
    master_server_id int unsigned,
@@ -28,7 +24,6 @@ create table `test`.`t1$EX`
    a int not null,
    d varchar(9) not null,
    primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
---enable_warnings
 --enable_query_log
 
 --echo *** Test 1 ********************************************************
@@ -78,3 +73,5 @@ drop table mysql.ndb_replication;
 drop table `test`.`t1$EX`;
 --sync_slave_with_master
 --enable_query_log
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_old.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_old.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_conflict_old.test	2011-04-08 11:06:53 +0000
@@ -6,10 +6,8 @@
 --source include/have_binlog_format_mixed_or_row.inc
 --source suite/rpl_ndb/ndb_master-slave.inc
 
---disable_warnings
 --disable_query_log
 --connection master
-drop table if exists mysql.ndb_replication;
 CREATE TABLE mysql.ndb_replication
   (db VARBINARY(63),
    table_name VARBINARY(63),
@@ -18,8 +16,6 @@ CREATE TABLE mysql.ndb_replication
    conflict_fn VARBINARY(128),
    PRIMARY KEY USING HASH (db,table_name,server_id))
   ENGINE=NDB PARTITION BY KEY(db,table_name);
-drop table if exists `test`.`t1$EX`;
-drop table if exists `test`.`t2$EX`;
 create table `test`.`t1$EX`
   (server_id int unsigned,
    master_server_id int unsigned,
@@ -28,7 +24,6 @@ create table `test`.`t1$EX`
    a int not null,
    d varchar(9) not null,
    primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
---enable_warnings
 --enable_query_log
 
 --echo *** Test 1 ********************************************************
@@ -78,3 +73,5 @@ drop table mysql.ndb_replication;
 drop table `test`.`t1$EX`;
 --sync_slave_with_master
 --enable_query_log
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test	2011-04-14 08:07:33 +0000
@@ -41,3 +41,4 @@ select * from t1 order by nid;
 connection master;
 DROP TABLE t1;
 sync_slave_with_master;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test	2011-04-08 11:06:53 +0000
@@ -1,6 +1,4 @@
 ###############################################
-# Author: JBM                                 #
-# Date: 2006-03-07                            #
 # Purpose: To test advance DD and replication #
 ###############################################
 
@@ -11,11 +9,6 @@
 --source include/not_embedded.inc
 --source suite/rpl_ndb/ndb_master-slave.inc
 
-#### Test start cleanup section #####
---disable_warnings
-DROP TABLE IF EXISTS t1, t2, t3;
---enable_warnings
-
 ######################################################
 # Requirment: Cluster DD and replication must be able#
 # to handle ALTER tables and indexes and must rpl    #
@@ -407,3 +400,4 @@ diff_files $MYSQLTEST_VARDIR/tmp/RPL_DD_
 --remove_file $MYSQLTEST_VARDIR/tmp/RPL_DD_ADV_S.sql
 
 # End 5.1 test case
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test	2011-04-08 11:06:53 +0000
@@ -82,4 +82,4 @@ drop datafile 'datafile02.dat'
 engine=ndb;
 DROP TABLESPACE ts1 ENGINE=NDB;
 DROP LOGFILE GROUP lg1 ENGINE=NDB;
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test	2011-04-08 11:06:53 +0000
@@ -308,3 +308,4 @@ DROP LOGFILE GROUP lg1 ENGINE=NDB;
 --sync_slave_with_master
 
 # End of 5.1 test case
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test	2011-04-08 11:06:53 +0000
@@ -31,3 +31,4 @@ let $temp_engine_type= MEMORY;
 let $show_binlog = 0;
 let $manipulate = 0;
 -- source extra/rpl_tests/rpl_ddl.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test	2011-04-14 08:07:33 +0000
@@ -6,3 +6,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_delete_no_where.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test	2011-04-14 08:07:33 +0000
@@ -54,3 +54,4 @@ DROP DATABASE IF EXISTS replica;
 --sync_slave_with_master
 
 # End 5.1 test case
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test	2011-04-14 08:07:33 +0000
@@ -43,3 +43,4 @@ INSERT INTO t1 VALUES (3, repeat('bad to
 connection master;
 DROP TABLE IF EXISTS t1, t2;
 --sync_slave_with_master
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_empty_epoch.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_empty_epoch.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_empty_epoch.test	2011-04-08 11:06:53 +0000
@@ -40,4 +40,4 @@ set global ndb_log_empty_epochs = @old_n
 --connection master
 DROP TABLE IF EXISTS t1,t2;
 
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test	2011-04-08 11:06:53 +0000
@@ -18,4 +18,7 @@ call mtr.add_suppression("Slave: Can't f
 call mtr.add_suppression("Slave: Got error 120 during COMMIT Error_code: 1180");
 -- enable_query_log
 
--- source extra/rpl_tests/rpl_extraSlave_Col.test
+-- source extra/rpl_tests/rpl_extra_col_slave.test
+
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_extraColMaster.test	2011-04-08 11:06:53 +0000
@@ -8,7 +8,9 @@
 let $engine_type = 'NDB';
 
 set binlog_format=row;
--- source extra/rpl_tests/rpl_extraMaster_Col.test
+-- source extra/rpl_tests/rpl_extra_col_master.test
 
 set binlog_format=mixed;
--- source extra/rpl_tests/rpl_extraMaster_Col.test
+-- source extra/rpl_tests/rpl_extra_col_master.test
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test	2011-04-14 08:07:33 +0000
@@ -10,4 +10,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_row_func003.test
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test	2011-03-15 17:29:28 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_gap_event.test	2011-04-08 11:06:53 +0000
@@ -25,6 +25,9 @@ select count(*) from t1;
 --connection master
 
 --echo Restarting mysqld
+ # Hack to allow using restart_mysqld.inc from rpl test
+let $allow_rpl_inited=1;
+
 let $mysqld_name=mysqld.1.1;
 --source include/restart_mysqld.inc
 #show binlog events in 'master-bin.000002';
@@ -42,12 +45,17 @@ drop table if exists t1;
 start slave;
 --enable_result_log
 
--- source include/wait_for_slave_sql_to_stop.inc
+let $slave_sql_errno= 1590;
+let $show_slave_sql_error=1;
+-- source include/wait_for_slave_sql_error.inc
 
 let $status_items= Slave_IO_Running, Slave_SQL_Running, Last_Errno, Last_Error;	
 -- source include/show_slave_status.inc
 
 drop table if exists t1;
 
+--source include/stop_slave_io.inc
+RESET SLAVE;
+
 
 

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test	2011-04-14 08:07:33 +0000
@@ -110,4 +110,4 @@ connection master;
 DROP TABLE IF EXISTS t1;
 
 # End of 5.1 Test
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db.test	2011-03-14 23:47:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ignore_db.test	2011-04-08 11:06:53 +0000
@@ -43,3 +43,5 @@ use test;
 drop table t3;
 
 --sync_slave_with_master slave
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test	2011-04-08 11:06:53 +0000
@@ -13,3 +13,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 SET storage_engine=innodb;
 --source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test	2011-04-14 08:07:33 +0000
@@ -64,3 +64,4 @@ connection master;
 
 drop table t1,t2;
 sync_slave_with_master;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test	2011-04-14 08:07:33 +0000
@@ -6,3 +6,4 @@
 let $engine_type=NDB;
 let $engine_type2=myisam;
 -- source extra/rpl_tests/rpl_insert_ignore.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_load.test	2011-04-08 11:06:53 +0000
@@ -64,3 +64,4 @@ CREATE TABLE SERVER
 #
 --exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
 --exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbAsyncGenerator  >> $NDB_TOOLS_OUTPUT
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_logging.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_logging.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_logging.test	2011-04-08 11:06:53 +0000
@@ -135,3 +135,5 @@ select * from t2;
 drop table t1;
 drop table t2;
 drop table mysql.ndb_replication;
+
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_eng_trans.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_eng_trans.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_eng_trans.test	2011-04-14 08:07:33 +0000
@@ -448,16 +448,13 @@ SELECT * FROM tndb ORDER BY a;
 --echo [on slave]
 --sync_slave_with_master
 
-let $diff_table_1=master:test.tmyisam;
-let $diff_table_2=slave:test.tmyisam;
+let $diff_tables= master:tmyisam, slave:tmyisam;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.tinnodb;
-let $diff_table_2=slave:test.tinnodb;
+let $diff_tables= master:tinnodb, slave:tinnodb;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.tndb;
-let $diff_table_2=slave:test.tndb;
+let $diff_tables= master:tndb, slave:tndb;
 source include/diff_tables.inc;
 
 
@@ -470,4 +467,4 @@ DROP TABLE tmyisam, tinnodb, tndb;
 --echo [on slave]
 sync_slave_with_master;
 
-source include/master-slave-end.inc;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mix_innodb.test	2011-04-08 11:06:53 +0000
@@ -1,6 +1,4 @@
 #############################################
-#Authors:    TU and Jeb
-#Date:       2007/04
 #Purpose:    Generic replication to cluster
 #            and ensuring that the ndb_apply_status
 #            table is updated.
@@ -16,3 +14,4 @@ let $off_set = 9;
 let $rpl_format = 'MIX';
 --source extra/rpl_tests/rpl_ndb_apply_status.test
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test	2011-04-14 08:07:33 +0000
@@ -316,28 +316,22 @@ SELECT * FROM ndb_myisam    ORDER BY a;
 SELECT * FROM innodb_ndb    ORDER BY a;
 SELECT * FROM ndb_innodb    ORDER BY a;
 
-let $diff_table_1=master:test.myisam_innodb;
-let $diff_table_2=slave:test.myisam_innodb;
+let $diff_tables= master:myisam_innodb, slave:myisam_innodb;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.innodb_myisam;
-let $diff_table_2=slave:test.innodb_myisam;
+let $diff_tables= master:innodb_myisam, slave:innodb_myisam;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.myisam_ndb;
-let $diff_table_2=slave:test.myisam_ndb;
+let $diff_tables= master:myisam_ndb, slave:myisam_ndb;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.ndb_myisam;
-let $diff_table_2=slave:test.ndb_myisam;
+let $diff_tables= master:ndb_myisam, slave:ndb_myisam;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.innodb_ndb;
-let $diff_table_2=slave:test.innodb_ndb;
+let $diff_tables= master:innodb_ndb, slave:innodb_ndb;
 source include/diff_tables.inc;
 
-let $diff_table_1=master:test.ndb_innodb;
-let $diff_table_2=slave:test.ndb_innodb;
+let $diff_tables= master:ndb_innodb, slave:ndb_innodb;
 source include/diff_tables.inc;
 
 
@@ -347,3 +341,4 @@ drop table myisam_innodb, innodb_myisam;
 drop table myisam_ndb, ndb_myisam;
 drop table innodb_ndb, ndb_innodb;
 sync_slave_with_master;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test	2011-04-14 08:07:33 +0000
@@ -1,6 +1,11 @@
 --source include/have_multi_ndb.inc
 --source include/have_binlog_format_mixed_or_row.inc
---source suite/rpl_ndb/ndb_master-slave.inc
+
+# We need server 3 later on in this test.
+--let $rpl_server_count= 3
+--source include/master-slave.inc
+
+--connection master
 
 # note: server2 is another "master" connected to the master cluster
 
@@ -50,13 +55,12 @@ let $the_pos= `SELECT @the_pos` ;
 let $the_file= `SELECT @the_file` ;
 
 # now connect the slave to the _other_ "master"
-connection slave;
---replace_result $MASTER_MYPORT1 <MASTER_PORT1> $the_pos MASTER_LOG_POS $the_file MASTER_LOG_FILE
-eval CHANGE MASTER TO
-  master_port=$MASTER_MYPORT1,
-  master_log_file = '$the_file',
-  master_log_pos = $the_pos ;
-start slave;
+--let $rpl_topology= 3->2
+--let $rpl_master_log_file= 2:$the_file
+--let $rpl_master_log_pos= 2:$the_pos
+--source include/rpl_change_topology.inc
+--connection slave
+--source include/start_slave.inc
 
 # insert some more values on the first master
 connection master;
@@ -73,7 +77,6 @@ connection server2;
 INSERT INTO t1 VALUES ("row5","E",5);
 SELECT * FROM t1 ORDER BY c3;
 sync_slave_with_master;
-connection slave;
 SELECT * FROM t1 ORDER BY c3;
 
 --echo ==== clean up ====
@@ -82,4 +85,4 @@ DROP TABLE t1;
 DROP TABLE t2;
 sync_slave_with_master;
 
-STOP SLAVE;
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test	2011-04-08 11:06:53 +0000
@@ -11,3 +11,4 @@
 
 let $engine_type=NDB;
 --source extra/rpl_tests/rpl_multi_update2.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test	2011-04-14 08:07:33 +0000
@@ -6,3 +6,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_multi_update3.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test	2011-04-08 11:06:53 +0000
@@ -12,3 +12,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 SET storage_engine=myisam;
 --source extra/rpl_tests/rpl_ndb_2multi_eng.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_relayrotate.test	2011-04-08 11:06:53 +0000
@@ -7,3 +7,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_relayrotate.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test	2011-04-14 08:07:33 +0000
@@ -55,3 +55,4 @@ DROP DATABASE IF EXISTS replica;
 --sync_slave_with_master
 
 # End 5.1 test case
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test	2011-04-14 08:07:33 +0000
@@ -5,3 +5,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_row_001.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_set_null.test	2011-04-08 11:06:53 +0000
@@ -4,3 +4,4 @@
 
 -- let $engine= NDB
 -- source extra/rpl_tests/rpl_set_null.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event.test	2011-03-15 00:46:48 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_skip_gap_event.test	2011-04-08 11:06:53 +0000
@@ -25,6 +25,8 @@ select count(*) from t1;
 --connection master
 
 --echo Restarting mysqld
+ # Hack to allow using restart_mysqld.inc from rpl test
+let $allow_rpl_inited=1;
 let $mysqld_name=mysqld.1.1;
 --source include/restart_mysqld.inc
 #show binlog events in 'master-bin.000002';
@@ -61,9 +63,12 @@ insert into t1 values (1001, 1001);
 
 select count(*) from t1;
 
-drop table if exists t1;
-
 --connection master
 drop table t1;
 
+--sync_slave_with_master
 
+# NOTE: rpl_end.inc doesnt seem to work after having used restart_mysqld.inc
+# or something like that...probably needs investigation
+--connection slave
+--source include/stop_slave.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_lsu.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_lsu.test	2009-09-16 16:04:14 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_lsu.test	2011-04-08 08:45:01 +0000
@@ -40,12 +40,6 @@ connect (srv_slave,127.0.0.1,root,,test,
 connect (srv_slave1,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
 connect (srv_slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,);
 
-connection slave;
---disable_warnings
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
---enable_warnings
-
 --echo *** Waiting for each cluster to startup ***
 
 # Check schema op binlogging enabled between servers on cluster1
@@ -119,7 +113,6 @@ source include/wait_for_slave_to_start.i
 --source suite/rpl_ndb/t/rpl_ndb_multi_binlog_update.inc
 
 
-
 --echo *** Configuring replication via Slave1 ***
 connection slave;
 --disable_warnings
@@ -127,12 +120,6 @@ STOP SLAVE;
 source include/wait_for_slave_to_stop.inc;
 --enable_warnings
 
-connection srv_slave1;
---disable_warnings
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
---enable_warnings
-
 # Reset state of all Binlogging nodes
 --disable_query_log
 connection master;
@@ -169,7 +156,6 @@ source include/wait_for_slave_to_start.i
 --source suite/rpl_ndb/t/rpl_ndb_multi_binlog_update.inc
 
 
-
 --echo *** Configuring replication via Slave2 ***
 connection srv_slave1;
 --disable_warnings
@@ -177,12 +163,6 @@ STOP SLAVE;
 source include/wait_for_slave_to_stop.inc;
 --enable_warnings
 
-connection srv_slave2;
---disable_warnings
-STOP SLAVE;
-source include/wait_for_slave_to_stop.inc;
---enable_warnings
-
 # Reset state of all Binlogging nodes
 --disable_query_log
 connection master;
@@ -217,3 +197,29 @@ source include/wait_for_slave_to_start.i
 
 --let $which_slave=srv_slave2
 --source suite/rpl_ndb/t/rpl_ndb_multi_binlog_update.inc
+
+##
+#
+# cleanup everything so that "check-testcase" doesn't fail
+# NOTE that if I didn't add the CHANGE MASTER TO MASTER_HOST="";
+# slave seems to still keep some config...
+# i.e that RESET SLAVE doesnt really "take-effect"
+#
+# probably needs investigation
+#
+--connection srv_slave
+--echo "cleanup srv_slave"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+
+--connection srv_slave1
+--echo "cleanup srv_slave1"
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";
+
+--connection srv_slave2
+--echo "cleanup srv_slave2"
+STOP SLAVE;
+source include/wait_for_slave_to_stop.inc;
+RESET SLAVE;
+CHANGE MASTER TO MASTER_HOST="";

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_restart.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_restart.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_slave_restart.test	2011-04-08 12:52:26 +0000
@@ -33,6 +33,7 @@ stop slave;
 
 # restart the slave server
 let $mysqld_name=mysqld.1.slave;
+let $allow_rpl_inited=1;
 --source include/restart_mysqld.inc
 
 # get the master binlog pos from the epoch, from the _other_ "master", server2
@@ -87,3 +88,10 @@ DROP TABLE t2;
 sync_slave_with_master;
 
 STOP SLAVE;
+
+# Reset slave back to first master 
+connection slave;
+--replace_result $MASTER_MYPORT <MASTER_PORT>
+eval CHANGE MASTER TO
+  master_port=$MASTER_MYPORT;
+

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test	2011-04-14 08:07:33 +0000
@@ -8,3 +8,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDBCLUSTER;
 -- source extra/rpl_tests/rpl_row_sp003.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test	2011-04-14 08:07:33 +0000
@@ -8,3 +8,4 @@
 -- source suite/rpl_ndb/ndb_master-slave.inc
 let $engine_type=NDBCLUSTER;
 -- source extra/rpl_tests/rpl_row_sp006.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_stm_innodb.test	2011-04-14 08:07:33 +0000
@@ -17,3 +17,4 @@ SET binlog_format = STATEMENT;
 let $off_set = 6;
 let $rpl_format = 'SBR';
 --source extra/rpl_tests/rpl_ndb_apply_status.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test	2011-04-14 08:07:33 +0000
@@ -98,3 +98,5 @@ reset slave;
 select * from mysql.ndb_apply_status;
 
 # End 5.1 Test
+--let $rpl_only_running_threads= 1
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test	2011-04-14 08:07:33 +0000
@@ -12,3 +12,4 @@
 let $engine_type=NDB;
 -- source extra/rpl_tests/rpl_trig004.test
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_all.test	2011-04-08 11:06:53 +0000
@@ -53,3 +53,4 @@ sync_slave_with_master;
 
 set global slave_type_conversions = @saved_slave_type_conversions;
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_lossy.test	2011-04-08 11:06:53 +0000
@@ -53,3 +53,4 @@ sync_slave_with_master;
 
 set global slave_type_conversions = @saved_slave_type_conversions;
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_nonlossy.test	2011-04-08 11:06:53 +0000
@@ -53,3 +53,5 @@ sync_slave_with_master;
 
 set global slave_type_conversions = @saved_slave_type_conversions;
 
+--source include/rpl_end.inc
+

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_typeconv_strict.test	2011-04-08 11:06:53 +0000
@@ -53,3 +53,4 @@ sync_slave_with_master;
 
 set global slave_type_conversions = @saved_slave_type_conversions;
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test	2011-04-08 11:06:53 +0000
@@ -10,3 +10,4 @@
 --exec echo Running mgmapi_logevent
 --exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" "$NDB_CONNECTSTRING_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
 
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test	2010-10-22 15:16:26 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test	2011-04-08 11:06:53 +0000
@@ -5,3 +5,4 @@
 let $type= 'NDB' ;
 let $extra_index= ;
 -- source extra/rpl_tests/rpl_row_basic.test
+--source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test	2010-10-27 11:32:32 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb.test	2011-04-14 08:07:33 +0000
@@ -63,4 +63,4 @@ connection master;
 DROP TABLE t1;
 source include/show_binlog_events.inc;
 
--- source include/master-slave-end.inc
+--source include/rpl_end.inc

=== modified file 'storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp'
--- a/storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp	2011-02-01 21:05:11 +0000
+++ b/storage/ndb/include/kernel/signaldata/SetLogLevelOrd.hpp	2011-04-07 07:22:49 +0000
@@ -55,7 +55,7 @@ private:
   
   SetLogLevelOrd& assign (const LogLevel& ll){
     noOfEntries = LogLevel::LOGLEVEL_CATEGORIES;
-    for(size_t i = 0; i<noOfEntries; i++){
+    for(Uint32 i = 0; i<noOfEntries; i++){
       theData[i] = (i << 16) | ll.getLogLevel((LogLevel::EventCategory)i);
     }
     return * this;
@@ -63,7 +63,7 @@ private:
 
   SetLogLevelOrd& assign (const EventSubscribeReq& ll){
     noOfEntries = ll.noOfEntries;
-    for(size_t i = 0; i<noOfEntries; i++){
+    for(Uint32 i = 0; i<noOfEntries; i++){
       theData[i] = ll.theData[i];
     }
     return * this;

=== modified file 'storage/ndb/include/portlib/ndb_socket_posix.h'
--- a/storage/ndb/include/portlib/ndb_socket_posix.h	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/include/portlib/ndb_socket_posix.h	2011-04-07 07:55:23 +0000
@@ -82,13 +82,13 @@ static inline ndb_socket_t my_socket_cre
   return s;
 }
 
-static inline size_t my_recv(ndb_socket_t s, char* buf, size_t len, int flags)
+static inline ssize_t my_recv(ndb_socket_t s, char* buf, size_t len, int flags)
 {
   return recv(s.fd, buf, len, flags);
 }
 
 static inline
-size_t my_send(ndb_socket_t s, const char* buf, size_t len, int flags)
+ssize_t my_send(ndb_socket_t s, const char* buf, size_t len, int flags)
 {
   return send(s.fd, buf, len, flags);
 }

=== modified file 'storage/ndb/include/portlib/ndb_socket_win32.h'
--- a/storage/ndb/include/portlib/ndb_socket_win32.h	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/include/portlib/ndb_socket_win32.h	2011-04-07 07:55:23 +0000
@@ -81,18 +81,18 @@ static inline ndb_socket_t my_socket_cre
   return s;
 }
 
-static inline size_t my_recv(ndb_socket_t s, char* buf, size_t len, int flags)
+static inline ssize_t my_recv(ndb_socket_t s, char* buf, size_t len, int flags)
 {
-  int ret= recv(s.s, buf, len, flags);
+  int ret= recv(s.s, buf, (int)len, flags);
   if (ret == SOCKET_ERROR)
     return -1;
   return ret;
 }
 
 static inline
-size_t my_send(ndb_socket_t s, const char* buf, size_t len, int flags)
+ssize_t my_send(ndb_socket_t s, const char* buf, size_t len, int flags)
 {
-  int ret= send(s.s, buf, len, flags);
+  int ret= send(s.s, buf, (int)len, flags);
   if (ret == SOCKET_ERROR)
     return -1;
   return ret;

=== modified file 'storage/ndb/include/util/HashMap.hpp'
--- a/storage/ndb/include/util/HashMap.hpp	2011-01-30 23:13:49 +0000
+++ b/storage/ndb/include/util/HashMap.hpp	2011-04-07 07:22:49 +0000
@@ -151,7 +151,7 @@ public:
   }
 
   bool remove(size_t i) {
-    Entry* entry = (Entry*)my_hash_element(&m_hash, i);
+    Entry* entry = (Entry*)my_hash_element(&m_hash, (ulong)i);
     if (entry == NULL)
       return false;
 
@@ -165,7 +165,7 @@ public:
   }
 
   T* value(size_t i) const {
-    Entry* entry = (Entry*)my_hash_element((HASH*)&m_hash, i);
+    Entry* entry = (Entry*)my_hash_element((HASH*)&m_hash, (ulong)i);
     if (entry == NULL)
       return NULL;
     return &(entry->m_value);

=== modified file 'storage/ndb/include/util/UtilBuffer.hpp'
--- a/storage/ndb/include/util/UtilBuffer.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/util/UtilBuffer.hpp	2011-04-07 07:22:49 +0000
@@ -89,7 +89,7 @@ public:
     len = 0;
   }
 
-  int length() const { return len; }
+  int length() const { assert(Uint64(len) == Uint32(len)); return (int)len; }
 
   void *get_data() const { return data; }
 

=== modified file 'storage/ndb/include/util/Vector.hpp'
--- a/storage/ndb/include/util/Vector.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/util/Vector.hpp	2011-04-07 07:22:49 +0000
@@ -51,7 +51,7 @@ public:
    */
   bool equal(const Vector<T>& obj) const;
 
-  int assign(const T*, Uint32 cnt);
+  int assign(const T*, unsigned cnt);
   int assign(const Vector<T>& obj) { return assign(obj.getBase(), obj.size());}
 
   T* getBase() { return m_items;}
@@ -94,7 +94,7 @@ Vector<T>::Vector(const Vector& src):
     m_incSize = 0;
     return;
   }
-  for(Uint32 i = 0; i < m_size; i++){
+  for(unsigned i = 0; i < m_size; i++){
     m_items[i] = src.m_items[i];
   }
 }
@@ -207,7 +207,7 @@ Vector<T>& 
 Vector<T>::operator=(const Vector<T>& obj){
   if(this != &obj){
     clear();
-    for(size_t i = 0; i<obj.size(); i++){
+    for(unsigned i = 0; i<obj.size(); i++){
       push_back(obj[i]);
     }
   }
@@ -216,10 +216,10 @@ Vector<T>::operator=(const Vector<T>& ob
 
 template<class T>
 int
-Vector<T>::assign(const T* src, Uint32 cnt)
+Vector<T>::assign(const T* src, unsigned cnt)
 {
   clear();
-  for (Uint32 i = 0; i<cnt; i++)
+  for (unsigned i = 0; i<cnt; i++)
   {
     int ret;
     if ((ret = push_back(src[i])))

=== modified file 'storage/ndb/src/common/debugger/EventLogger.cpp'
--- a/storage/ndb/src/common/debugger/EventLogger.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp	2011-04-07 07:22:49 +0000
@@ -757,7 +757,7 @@ void getTextUNDORecordsExecuted(QQQQ) {
 		       theData[11]);
 }
 void getTextInfoEvent(QQQQ) {
-  BaseString::snprintf(m_text, m_text_len, (char *)&theData[1]);
+  BaseString::snprintf(m_text, m_text_len, "%s", (char *)&theData[1]);
 }
 const char bytes_unit[]= "B";
 const char kbytes_unit[]= "KB";
@@ -797,7 +797,7 @@ void getTextEventBufferStatus(QQQQ) {
 		       theData[7], theData[6]);
 }
 void getTextWarningEvent(QQQQ) {
-  BaseString::snprintf(m_text, m_text_len, (char *)&theData[1]);
+  BaseString::snprintf(m_text, m_text_len, "%s", (char *)&theData[1]);
 }
 void getTextGCP_TakeoverStarted(QQQQ) {
   BaseString::snprintf(m_text, m_text_len, "GCP Take over started");
@@ -1393,25 +1393,25 @@ EventLogger::log(int eventType, const Ui
 
     switch (severity){
     case Logger::LL_ALERT:
-      alert(log_text);
+      alert("%s", log_text);
       break;
     case Logger::LL_CRITICAL:
-      critical(log_text); 
+      critical("%s", log_text);
       break;
     case Logger::LL_WARNING:
-      warning(log_text); 
+      warning("%s", log_text);
       break;
     case Logger::LL_ERROR:
-      error(log_text); 
+      error("%s", log_text);
       break;
     case Logger::LL_INFO:
-      info(log_text); 
+      info("%s", log_text);
       break;
     case Logger::LL_DEBUG:
-      debug(log_text); 
+      debug("%s", log_text);
       break;
     default:
-      info(log_text); 
+      info("%s", log_text);
       break;
     }
   } // if (..

=== modified file 'storage/ndb/src/common/transporter/TCP_Transporter.cpp'
--- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2011-04-07 08:48:50 +0000
@@ -392,7 +392,7 @@ TCP_Transporter::doReceive() {
   // It reads the external TCP/IP interface once
   Uint32 size = receiveBuffer.sizeOfBuffer - receiveBuffer.sizeOfData;
   if(size > 0){
-    const int nBytesRead = my_recv(theSocket,
+    const int nBytesRead = (int)my_recv(theSocket,
 				receiveBuffer.insertPtr,
 				size < maxReceiveSize ? size : maxReceiveSize,
 				0);

=== modified file 'storage/ndb/src/common/transporter/TransporterRegistry.cpp'
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2011-04-07 08:48:50 +0000
@@ -1270,7 +1270,7 @@ void
 TransporterRegistry::consume_extra_sockets()
 {
   char buf[4096];
-  int ret;
+  ssize_t ret;
   int err;
   NDB_SOCKET_TYPE sock = m_extra_wakeup_sockets[0];
   do

=== modified file 'storage/ndb/src/common/util/File.cpp'
--- a/storage/ndb/src/common/util/File.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/File.cpp	2011-04-07 07:22:49 +0000
@@ -71,7 +71,7 @@ File_class::File_class(const char* aFile
   m_file(NULL), 
   m_fileMode(mode)
 {
-  BaseString::snprintf(m_fileName, PATH_MAX, aFileName);
+  BaseString::snprintf(m_fileName, PATH_MAX, "%s", aFileName);
 }
 
 bool
@@ -88,7 +88,7 @@ File_class::open(const char* aFileName, 
     /**
      * Only copy if it's not the same string
      */
-    BaseString::snprintf(m_fileName, PATH_MAX, aFileName);
+    BaseString::snprintf(m_fileName, PATH_MAX, "%s", aFileName);
   }
   m_fileMode = mode;
   bool rc = true;

=== modified file 'storage/ndb/src/common/util/socket_io.cpp'
--- a/storage/ndb/src/common/util/socket_io.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/util/socket_io.cpp	2011-04-07 08:48:50 +0000
@@ -61,7 +61,7 @@ read_socket(NDB_SOCKET_TYPE socket, int 
   if (res <= 0)
     return res;
 
-  return my_recv(socket, &buf[0], buflen, 0);
+  return (int)my_recv(socket, &buf[0], buflen, 0);
 }
 
 extern "C"
@@ -88,7 +88,7 @@ readln_socket(NDB_SOCKET_TYPE socket, in
   do
   {
     int t;
-    while((t = my_recv(socket, ptr, len, MSG_PEEK)) == -1
+    while((t = (int)my_recv(socket, ptr, len, MSG_PEEK)) == -1
           && socket_errno == EINTR);
     
     if(t < 1)
@@ -106,7 +106,7 @@ readln_socket(NDB_SOCKET_TYPE socket, in
 	 */
 	for (len = 1 + i; len; )
 	{
-	  while ((t = my_recv(socket, ptr, len, 0)) == -1
+	  while ((t = (int)my_recv(socket, ptr, len, 0)) == -1
                  && socket_errno == EINTR);
 	  if (t < 1)
 	    return -1;
@@ -129,7 +129,7 @@ readln_socket(NDB_SOCKET_TYPE socket, in
     
     for (int tmp = t; tmp; )
     {
-      while ((t = my_recv(socket, ptr, tmp, 0)) == -1 && socket_errno == EINTR);
+      while ((t = (int)my_recv(socket, ptr, tmp, 0)) == -1 && socket_errno == EINTR);
       if (t < 1)
       {
 	return -1;
@@ -166,7 +166,7 @@ write_socket(NDB_SOCKET_TYPE socket, int
 
   const char * tmp = &buf[0];
   while(len > 0){
-    const int w = my_send(socket, tmp, len, 0);
+    const int w = (int)my_send(socket, tmp, len, 0);
     if(w == -1){
       return -1;
     }

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-03-15 16:11:47 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-04-07 07:22:49 +0000
@@ -3946,7 +3946,7 @@ Dbdict::startRestoreSchema(Signal* signa
   if (c_restartRecord.m_start_banner)
   {
     jam();
-    infoEvent(c_restartRecord.m_start_banner);
+    infoEvent("%s", c_restartRecord.m_start_banner);
   }
 }
 
@@ -4168,7 +4168,7 @@ Dbdict::restart_fromWriteSchemaFile(Sign
   if (c_restartRecord.m_end_banner)
   {
     jam();
-    infoEvent(c_restartRecord.m_end_banner);
+    infoEvent("%s", c_restartRecord.m_end_banner);
   }
 
   execute(signal, c_schemaRecord.m_callback, retCode);

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-04-05 09:38:31 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-04-07 07:22:49 +0000
@@ -22159,12 +22159,12 @@ Dblqh::match_and_print(Signal* signal, P
 		       tcRec.p->transid[0], tcRec.p->transid[1],
 		       op,
 		       state);
-  
+
   if (!ERROR_INSERTED(4002))
-    infoEvent(buf);
+    infoEvent("%s", buf);
   else
-    ndbout_c(buf);
-  
+    ndbout_c("%s", buf);
+
   memcpy(signal->theData, temp, 4*len);
   return true;
 }
@@ -22809,7 +22809,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
 			   "OP[%u]: transid: 0x%x 0x%x key: %s",
 			   tcRec.i,
 			   tcRec.p->transid[0], tcRec.p->transid[1], key.c_str());
-      infoEvent(buf);
+      infoEvent("%s", buf);
     }
   }
   

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2011-02-07 13:21:49 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp	2011-04-07 07:22:49 +0000
@@ -611,6 +611,10 @@ void Dbtup::execTUPFRAGREQ(Signal* signa
   Uint64 minRows =
     (((Uint64)req->minRowsHigh) << 32) + req->minRowsLow;
 
+  (void)reqinfo;
+  (void)maxRows;
+  (void)minRows;
+
   if (req->userPtr == (Uint32)-1) 
   {
     jam();
@@ -2456,14 +2460,14 @@ Dbtup::start_restore_lcp(Uint32 tableId,
   TablerecPtr tabPtr;
   tabPtr.i= tableId;
   ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
-  
-  ndbassert(tabPtr.p->m_attributes[DD].m_no_of_fixsize < (1 << 16));
-  ndbassert(tabPtr.p->m_attributes[DD].m_no_of_varsize < (1 << 16));
-  
-  Uint32 saveAttrCounts = 
-    (tabPtr.p->m_attributes[DD].m_no_of_fixsize << 16) |
-    (tabPtr.p->m_attributes[DD].m_no_of_varsize << 0);
-  
+
+  ndbassert(Uint16(tabPtr.p->m_attributes[DD].m_no_of_fixsize << 16) == 0);
+  ndbassert(Uint16(tabPtr.p->m_attributes[DD].m_no_of_varsize << 16) == 0);
+
+  Uint32 saveAttrCounts =
+    (Uint32(tabPtr.p->m_attributes[DD].m_no_of_fixsize) << 16) |
+    (Uint32(tabPtr.p->m_attributes[DD].m_no_of_varsize) << 0);
+
   tabPtr.p->m_dropTable.tabUserPtr= saveAttrCounts;
   tabPtr.p->m_dropTable.tabUserRef= (tabPtr.p->m_bits & Tablerec::TR_RowGCI)? 1 : 0;
   tabPtr.p->m_createTable.defValLocation = tabPtr.p->m_default_value_location;

=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2011-02-23 19:28:26 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2011-04-07 07:22:49 +0000
@@ -1117,7 +1117,7 @@ retry:
 		       "I think president is: %d",
 		       nodeId, president, cpresident);
 
-  ndbout_c(buf);
+  ndbout_c("%s", buf);
   CRASH_INSERTION(933);
 
   if (getNodeState().startLevel == NodeState::SL_STARTED)
@@ -2791,7 +2791,7 @@ void Qmgr::checkStartInterface(Signal* s
                                nodePtr.i, 
                                (getNodeInfo(nodePtr.i).m_heartbeat_cnt + 1)/60,
                                nodePtr.p->failState);
-	  warningEvent(buf);
+	  warningEvent("%s", buf);
           if (((getNodeInfo(nodePtr.i).m_heartbeat_cnt + 1) % 300) == 0)
           {
             jam();
@@ -5772,7 +5772,7 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal)
         sprintf(buf, "Node %d: <UNKNOWN>(%d)", i, nodePtr.p->phase);
         break;
       }
-      infoEvent(buf);
+      infoEvent("%s", buf);
     }
   }
 

=== modified file 'storage/ndb/src/mgmsrv/Services.cpp'
--- a/storage/ndb/src/mgmsrv/Services.cpp	2011-03-28 09:01:03 +0000
+++ b/storage/ndb/src/mgmsrv/Services.cpp	2011-04-07 10:55:42 +0000
@@ -430,11 +430,16 @@ MgmApiSession::runSession()
 
       if (msg){
         g_eventLogger->debug("%s: %s, '%s'",
-                             name(), msg, ctx.m_currentToken);
+                             name(),
+                             msg,
+                             ctx.m_currentToken != 0 ?
+                             ctx.m_currentToken : "<NULL>");
 
         // Send result to client
         m_output->println("result: %s, '%s'",
-                          msg, ctx.m_currentToken);
+                          msg,
+                          ctx.m_currentToken != 0 ?
+                          ctx.m_currentToken : "<NULL>");
         m_output->print("\n");
       }
     }

=== modified file 'storage/ndb/test/ndbapi/bank/Bank.cpp'
--- a/storage/ndb/test/ndbapi/bank/Bank.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/bank/Bank.cpp	2011-04-07 07:22:49 +0000
@@ -2221,7 +2221,7 @@ int Bank::increaseSystemValue(SystemValu
     printf("value actual=%lld\n", valueNewRec->u_64_value());
     printf("value expected=%lld actual=%lld\n", value, valueNewRec->u_64_value());
     
-    DBUG_PRINT("info", ("value expected=%ld actual=%ld", value, valueNewRec->u_64_value()));
+    DBUG_PRINT("info", ("value expected=%ld actual=%ld", (long)value, (long)valueNewRec->u_64_value()));
     g_err << "getNextTransactionId: value was not updated" << endl;
     m_ndb.closeTransaction(pTrans);
     DBUG_RETURN(NDBT_FAILED);

=== modified file 'storage/ndb/test/ndbapi/testBasic.cpp'
--- a/storage/ndb/test/ndbapi/testBasic.cpp	2011-01-30 20:56:00 +0000
+++ b/storage/ndb/test/ndbapi/testBasic.cpp	2011-04-07 07:22:49 +0000
@@ -1287,12 +1287,12 @@ int
 runBug25090(NDBT_Context* ctx, NDBT_Step* step){
   
   Ndb* pNdb = GETNDB(step);
-  NdbDictionary::Dictionary * dict = pNdb->getDictionary();
+  //NdbDictionary::Dictionary * dict = pNdb->getDictionary();
 
   HugoOperations ops(*ctx->getTab());
   
   int loops = ctx->getNumLoops();
-  const int rows = ctx->getNumRecords();
+  //const int rows = ctx->getNumRecords();
   
   while (loops--)
   {
@@ -1317,7 +1317,7 @@ runDeleteRead(NDBT_Context* ctx, NDBT_St
 
   int a;
   int loops = ctx->getNumLoops();
-  const int rows = ctx->getNumRecords();
+  //const int rows = ctx->getNumRecords();
   
   while (loops--)
   {
@@ -1371,12 +1371,12 @@ runBug27756(NDBT_Context* ctx, NDBT_Step
 {
   
   Ndb* pNdb = GETNDB(step);
-  NdbDictionary::Dictionary * dict = pNdb->getDictionary();
+  //NdbDictionary::Dictionary * dict = pNdb->getDictionary();
   
   HugoOperations ops(*ctx->getTab());
 
   int loops = ctx->getNumLoops();
-  const int rows = ctx->getNumRecords();
+  //const int rows = ctx->getNumRecords();
   
   Vector<Uint64> copies;
   while (loops--)
@@ -1832,7 +1832,7 @@ runBug34348(NDBT_Context* ctx, NDBT_Step
         }
       }
       chk1(result == NDBT_OK);
-      assert(BitmaskImpl::count(sz, rowmask)== rowcnt);
+      assert(BitmaskImpl::count(sz, rowmask)== (Uint32)rowcnt);
 
       // delete about 1/2 remaining
       while (result == NDBT_OK)
@@ -1852,7 +1852,7 @@ runBug34348(NDBT_Context* ctx, NDBT_Step
         break;
       }
       chk1(result == NDBT_OK);
-      assert(BitmaskImpl::count(sz, rowmask)== rowcnt);
+      assert(BitmaskImpl::count(sz, rowmask)== (Uint32)rowcnt);
 
       // insert until full again
       while (result == NDBT_OK)
@@ -1874,7 +1874,7 @@ runBug34348(NDBT_Context* ctx, NDBT_Step
         break;
       }
       chk1(result == NDBT_OK);
-      assert(BitmaskImpl::count(sz, rowmask)== rowcnt);
+      assert(BitmaskImpl::count(sz, rowmask)== (Uint32)rowcnt);
 
       // delete all
       while (result == NDBT_OK)
@@ -1892,7 +1892,7 @@ runBug34348(NDBT_Context* ctx, NDBT_Step
         break;
       }
       chk1(result == NDBT_OK);
-      assert(BitmaskImpl::count(sz, rowmask)== rowcnt);
+      assert(BitmaskImpl::count(sz, rowmask)== (Uint32)rowcnt);
       assert(rowcnt == 0);
 
       loop++;

=== modified file 'storage/ndb/test/ndbapi/testDict.cpp'
--- a/storage/ndb/test/ndbapi/testDict.cpp	2011-02-21 15:08:51 +0000
+++ b/storage/ndb/test/ndbapi/testDict.cpp	2011-04-07 07:22:49 +0000
@@ -8123,7 +8123,7 @@ runBug58277errtest(NDBT_Context* ctx, ND
   NdbDictionary::Dictionary* pDic = pNdb->getDictionary();
   const int loops = ctx->getNumLoops();
   int result = NDBT_OK;
-  const int rows = ctx->getNumRecords();
+  //const int rows = ctx->getNumRecords();
   NdbRestarter restarter;
   const char* tabname = tabName_Bug58277;
   const char* indname = indName_Bug58277;
@@ -8342,7 +8342,6 @@ runBug58277scanop(NDBT_Context* ctx, NDB
           }
           if (type == 3)
           {
-            NdbOperation* pOp = 0;
             CHK2(pSOp->deleteCurrentTuple(pTx) == 0, pSOp->getNdbError());
             break;
           }
@@ -8640,7 +8639,7 @@ runBug57057(NDBT_Context* ctx, NDBT_Step
   const bool rss_check = ctx->getProperty("RSS_CHECK", (Uint32)0);
   NdbRestarter restarter;
   const char* tabname = tabName_Bug58277;
-  const char* indname = indName_Bug58277;
+  //const char* indname = indName_Bug58277;
   (void)pDic->dropTable(tabname);
 
   int loop = 0;

=== modified file 'storage/ndb/test/ndbapi/testIndex.cpp'
--- a/storage/ndb/test/ndbapi/testIndex.cpp	2011-04-01 07:10:05 +0000
+++ b/storage/ndb/test/ndbapi/testIndex.cpp	2011-04-07 07:22:49 +0000
@@ -2612,7 +2612,7 @@ runBug56829(NDBT_Context* ctx, NDBT_Step
         const NdbDictionary::Column* col = pTab->getColumn(j);
         if (col->getPrimaryKey() || calc.isUpdateCol(j))
           continue;
-        CHARSET_INFO* cs = col->getCharset();
+        //CHARSET_INFO* cs = col->getCharset();
         if (NdbSqlUtil::check_column_for_ordered_index(col->getType(), col->getCharset()) == 0)
         {
           ind.addColumn(*col);

=== modified file 'storage/ndb/test/ndbapi/testLcp.cpp'
--- a/storage/ndb/test/ndbapi/testLcp.cpp	2011-03-14 15:13:48 +0000
+++ b/storage/ndb/test/ndbapi/testLcp.cpp	2011-04-14 08:07:33 +0000
@@ -343,7 +343,7 @@ static int load_table()
   size_t op = 0;
   size_t rows = 0;
   size_t uncommitted = 0;
-  bool prepared = false;
+  //bool prepared = false;
   for(size_t i = 0; i<(size_t)g_rows; i++){
     for(op %= OP_COUNT; !((1 << op) & g_use_ops); op = (op + 1) % OP_COUNT);
     g_ops[i] = g_op_types[op++];

=== modified file 'storage/ndb/test/ndbapi/testNodeRestart.cpp'
--- a/storage/ndb/test/ndbapi/testNodeRestart.cpp	2011-02-21 13:17:16 +0000
+++ b/storage/ndb/test/ndbapi/testNodeRestart.cpp	2011-04-07 07:22:49 +0000
@@ -2344,10 +2344,10 @@ runDropBigTable(NDBT_Context* ctx, NDBT_
 int
 runBug31525(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
-  Ndb* pNdb = GETNDB(step);
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
+  //int records = ctx->getNumRecords();
+  //Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 2)
@@ -2418,9 +2418,9 @@ runBug31525(NDBT_Context* ctx, NDBT_Step
 int
 runBug31980(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
+  //int records = ctx->getNumRecords();
   Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
@@ -2470,10 +2470,10 @@ runBug31980(NDBT_Context* ctx, NDBT_Step
 int
 runBug32160(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
-  Ndb* pNdb = GETNDB(step);
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
+  //int records = ctx->getNumRecords();
+  //Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 2)
@@ -2515,10 +2515,10 @@ runBug32160(NDBT_Context* ctx, NDBT_Step
 int
 runBug32922(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
-  Ndb* pNdb = GETNDB(step);
+  //int records = ctx->getNumRecords();
+  //Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 2)
@@ -2744,10 +2744,10 @@ runNF_commit(NDBT_Context* ctx, NDBT_Ste
 int
 runBug34702(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
-  Ndb* pNdb = GETNDB(step);
+  //int records = ctx->getNumRecords();
+  //Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 2)
@@ -2780,7 +2780,7 @@ runBug34702(NDBT_Context* ctx, NDBT_Step
 int
 runMNF(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   NdbRestarter res;
   
   if (res.getNumDbNodes() < 2)
@@ -2981,8 +2981,8 @@ runMNF(NDBT_Context* ctx, NDBT_Step* ste
 int 
 runBug36199(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 4)
@@ -3030,8 +3030,8 @@ runBug36199(NDBT_Context* ctx, NDBT_Step
 int 
 runBug36246(NDBT_Context* ctx, NDBT_Step* step)
 { 
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
   NdbRestarter res;
   Ndb* pNdb = GETNDB(step);
 
@@ -3118,8 +3118,8 @@ loop:
 int 
 runBug36247(NDBT_Context* ctx, NDBT_Step* step)
 { 
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
   NdbRestarter res;
   Ndb* pNdb = GETNDB(step);
 
@@ -3212,10 +3212,10 @@ loop:
 int 
 runBug36276(NDBT_Context* ctx, NDBT_Step* step)
 { 
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
   NdbRestarter res;
-  Ndb* pNdb = GETNDB(step);
+  //Ndb* pNdb = GETNDB(step);
   
   if (res.getNumDbNodes() < 4)
     return NDBT_OK;
@@ -3257,8 +3257,8 @@ runBug36276(NDBT_Context* ctx, NDBT_Step
 int 
 runBug36245(NDBT_Context* ctx, NDBT_Step* step)
 { 
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
   NdbRestarter res;
   Ndb* pNdb = GETNDB(step);
 
@@ -3767,10 +3767,10 @@ runBug44952(NDBT_Context* ctx, NDBT_Step
 
   const int codes [] = {
     5051, 5052, 5053, 0
-  };
+  }; (void)codes;
 
-  int randomId = myRandom48(res.getNumDbNodes());
-  int nodeId = res.getDbNodeId(randomId);
+  //int randomId = myRandom48(res.getNumDbNodes());
+  //int nodeId = res.getDbNodeId(randomId);
 
   int loops = ctx->getNumLoops();
   const int val[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 } ;

=== modified file 'storage/ndb/test/ndbapi/testReadPerf.cpp'
--- a/storage/ndb/test/ndbapi/testReadPerf.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testReadPerf.cpp	2011-04-07 07:22:49 +0000
@@ -138,7 +138,7 @@ main(int argc, const char** argv){
   for(i = optind; i<argc; i++){
     const char * T = argv[i];
     g_info << "Testing " << T << endl;
-    BaseString::snprintf(g_table, sizeof(g_table), T);
+    BaseString::snprintf(g_table, sizeof(g_table), "%s", T);
     BaseString::snprintf(g_ordered, sizeof(g_ordered), "IDX_O_%s", T);
     BaseString::snprintf(g_unique, sizeof(g_unique), "IDX_U_%s", T);
     if(create_table())
@@ -254,9 +254,9 @@ void err(NdbError e){
 
 int
 run_read(){
-  int iter = g_paramters[P_LOOPS].value;
+  //int iter = g_paramters[P_LOOPS].value;
   NDB_TICKS start1, stop;
-  int sum_time= 0;
+  //int sum_time= 0;
   
   const Uint32 rows = g_paramters[P_ROWS].value;
   const Uint32 range = g_paramters[P_RANGE].value;

=== modified file 'storage/ndb/test/ndbapi/testSRBank.cpp'
--- a/storage/ndb/test/ndbapi/testSRBank.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testSRBank.cpp	2011-04-07 07:22:49 +0000
@@ -81,7 +81,7 @@ int runBankTransactions(NDBT_Context* ct
     Bank bank(ctx->m_cluster_connection);
     while(!ctx->isTestStopped() && 
           ctx->getProperty(NMR_SR) <= NdbMixRestarter::SR_STOPPING)
-      if(bank.performTransactions(0, 1) == NDBT_FAILED)
+      if(bank.performTransactions(wait, yield) == NDBT_FAILED)
 	break;
     
     ndbout_c("runBankTransactions is stopped");
@@ -94,7 +94,7 @@ int runBankTransactions(NDBT_Context* ct
 
 int runBankGL(NDBT_Context* ctx, NDBT_Step* step){
   int yield = 1; // Loops before bank returns 
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   
   ctx->incProperty(NMR_SR_THREADS);
   while (ctx->isTestStopped() == false) 
@@ -179,7 +179,7 @@ int runBankSum(NDBT_Context* ctx, NDBT_S
 int
 runMixRestart(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   NdbMixRestarter res;
   int runtime = ctx->getNumLoops();
   int sleeptime = ctx->getNumRecords();

=== modified file 'storage/ndb/test/ndbapi/testScan.cpp'
--- a/storage/ndb/test/ndbapi/testScan.cpp	2011-04-05 09:12:21 +0000
+++ b/storage/ndb/test/ndbapi/testScan.cpp	2011-04-07 07:22:49 +0000
@@ -626,7 +626,7 @@ int runScanUpdate(NDBT_Context* ctx, NDB
 }
 
 int runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){
-  int records = ctx->getNumRecords();
+  //int records = ctx->getNumRecords();
   int i = 0;
 
   int parallelism = ctx->getProperty("Parallelism", 240);
@@ -1109,8 +1109,8 @@ runScanParallelism(NDBT_Context* ctx, ND
 int
 runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
+  //int loops = ctx->getNumLoops();
+  //int records = ctx->getNumRecords();
   Ndb * pNdb = GETNDB(step);
   const NdbDictionary::Table*  pTab = ctx->getTab();
   
@@ -1176,7 +1176,7 @@ runScanVariants(NDBT_Context* ctx, NDBT_
 	    }
 	    
 	    int res;
-	    int row = 0;
+	    //int row = 0;
 	    while((res = pOp->nextResult()) == 0);
 	  }
 	  pCon->close();
@@ -1247,7 +1247,7 @@ runBug24447(NDBT_Context* ctx, NDBT_Step
       return NDBT_FAILED;
     }
 
-    for (Uint32 j = 0; i<10; i++)
+    for (Uint32 j = 0; j<10; j++)
     {
       hugoTrans.scanReadRecords(GETNDB(step), records, abort, 0, 
 				NdbOperation::LM_CommittedRead);

=== modified file 'storage/ndb/test/ndbapi/testScanPerf.cpp'
--- a/storage/ndb/test/ndbapi/testScanPerf.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testScanPerf.cpp	2011-04-07 07:22:49 +0000
@@ -125,7 +125,7 @@ main(int argc, const char** argv){
   for(i = optind; i<argc; i++){
     const char * T = argv[i];
     g_info << "Testing " << T << endl;
-    BaseString::snprintf(g_tablename, sizeof(g_tablename), T);
+    BaseString::snprintf(g_tablename, sizeof(g_tablename), "%s", T);
     BaseString::snprintf(g_indexname, sizeof(g_indexname), "IDX_%s", T);
     if(create_table())
       goto error;

=== modified file 'storage/ndb/test/ndbapi/testTimeout.cpp'
--- a/storage/ndb/test/ndbapi/testTimeout.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/ndbapi/testTimeout.cpp	2011-04-07 07:22:49 +0000
@@ -500,8 +500,8 @@ int runScanRefreshNoTimeout(NDBT_Context
 int 
 runError4012(NDBT_Context* ctx, NDBT_Step* step){
   int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
-  int stepNo = step->getStepNo();
+  //int loops = ctx->getNumLoops();
+  //int stepNo = step->getStepNo();
   
   int timeout = ctx->getProperty("TransactionDeadlockTimeout", TIMEOUT);
 

=== modified file 'storage/ndb/test/ndbapi/test_event.cpp'
--- a/storage/ndb/test/ndbapi/test_event.cpp	2011-02-21 14:10:20 +0000
+++ b/storage/ndb/test/ndbapi/test_event.cpp	2011-04-07 07:22:49 +0000
@@ -904,7 +904,7 @@ int runEventConsumer(NDBT_Context* ctx, 
 
   while(!ctx->isTestStopped())
   {
-    int count= 0;
+    //int count= 0;
     Ndb* ndb= GETNDB(step);
 
     Uint64 last_gci = 0;
@@ -1003,7 +1003,7 @@ end:
 
 int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
   int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
+  //int loops = ctx->getNumLoops();
   NdbRestarter restarter;
   int i = 0;
   int lastId = 0;
@@ -1903,7 +1903,7 @@ runLoadTable(NDBT_Context* ctx, NDBT_Ste
 
 int 
 runScanUpdateUntilStopped(NDBT_Context* ctx, NDBT_Step* step){
-  int records = ctx->getNumRecords();
+  //int records = ctx->getNumRecords();
   int parallelism = ctx->getProperty("Parallelism", (Uint32)0);
   int abort = ctx->getProperty("AbortProb", (Uint32)0);
   HugoTransactions hugoTrans(*ctx->getTab());
@@ -1920,7 +1920,7 @@ runScanUpdateUntilStopped(NDBT_Context* 
 int 
 runInsertDeleteUntilStopped(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   int records = ctx->getNumRecords();
   HugoTransactions hugoTrans(*ctx->getTab());
   UtilTransactions utilTrans(*ctx->getTab());
@@ -1940,7 +1940,7 @@ runInsertDeleteUntilStopped(NDBT_Context
 int 
 runBug31701(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
 
   NdbRestarter restarter;
 
@@ -2189,7 +2189,7 @@ cleanup:
 int 
 runBug33793(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
   int loops = ctx->getNumLoops();
 
   NdbRestarter restarter;
@@ -2305,10 +2305,10 @@ op(Ndb* xndb, const NdbDictionary::Table
 int
 runBug34853(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
-  int loops = ctx->getNumLoops();
-  int records = ctx->getNumRecords();
-  Ndb* pNdb = GETNDB(step);
+  //int result = NDBT_OK;
+  //int loops = ctx->getNumLoops();
+  //int records = ctx->getNumRecords();
+  //Ndb* pNdb = GETNDB(step);
   NdbRestarter res;
 
   if (res.getNumDbNodes() < 2)
@@ -2698,7 +2698,7 @@ runBug37279(NDBT_Context* ctx, NDBT_Step
   NdbDictionary::Dictionary* dict = pNdb->getDictionary();
   
   const NdbDictionary::Table* tab = dict->getTable(ctx->getTab()->getName());
-  const NdbDictionary::Table* org = tab;
+  //const NdbDictionary::Table* org = tab;
   NdbEventOperation* pOp0 = createEventOperation(pNdb, *tab);
   
   if (pOp0 == 0)
@@ -3199,7 +3199,7 @@ runBug37672(NDBT_Context* ctx, NDBT_Step
 int
 runBug30780(NDBT_Context* ctx, NDBT_Step* step)
 {
-  int result = NDBT_OK;
+  //int result = NDBT_OK;
 
   NdbRestarter res;
 

=== modified file 'storage/ndb/test/src/HugoOperations.cpp'
--- a/storage/ndb/test/src/HugoOperations.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/src/HugoOperations.cpp	2011-04-07 07:22:49 +0000
@@ -1122,6 +1122,7 @@ HugoOperations::releaseLockHandles(Ndb* 
         return NDBT_FAILED;
       }
       const NdbLockHandle* nullPtr = NULL;
+      (void)nullPtr; // ??
       //lockHandles.set(nullPtr, offset + i, nullPtr);
     }
     else

=== modified file 'storage/ndb/test/tools/verify_index.cpp'
--- a/storage/ndb/test/tools/verify_index.cpp	2011-02-02 00:40:07 +0000
+++ b/storage/ndb/test/tools/verify_index.cpp	2011-04-07 07:22:49 +0000
@@ -78,7 +78,6 @@ int main(int argc, const char** argv){
     return NDBT_ProgramExit(NDBT_FAILED);
   }
 
-  int rows = 0;
   UtilTransactions utilTrans(*pTab);
   if (utilTrans.verifyIndex(&MyNdb, 
 			    _indexname, 

=== modified file 'storage/ndb/tools/ndb_test_platform.cpp'
--- a/storage/ndb/tools/ndb_test_platform.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/tools/ndb_test_platform.cpp	2011-04-07 07:22:49 +0000
@@ -28,7 +28,7 @@ int test_snprintf(const char * fmt, int 
 {
   int ret;
   char buf[100];
-  ret = BaseString::snprintf(buf, buf_sz, fmt);
+  ret = BaseString::snprintf(buf, buf_sz, "%s", fmt);
   
   if(ret < 0)
   {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster branch (magnus.blaudd:3278 to 3279) Magnus Blåudd14 Apr