List:Commits« Previous MessageNext Message »
From:Luis Soares Date:March 26 2010 11:09am
Subject:bzr commit into mysql-5.1-rpl-wl5092 branch (luis.soares:3182) WL#5096
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/features/wl5092/mysql-5.1-rpl-wl5092/ based on revid:luis.soares@stripped

 3182 Luis Soares	2010-03-26
      WL#5096 -- Addressing review comments
      
      rpl_row_record_find_* 
      
        - Removed these tests which are now superseded by
          rpl_row_img.test
      
      diff_tables.inc
      
        - Refactored so that it is now possible to specify tables on any
          two connections, instead of just master and slave.
      
      diff_tables2.inc
      
        - Moved its contents to diff_tables.inc and removed it.
      
      rpl_row_img_set.inc
      
        - Refactored and made generic. 
        - It takes a list of connections and binlog-row-image
          values. Runs through the list and sets the respective
          value. It also takes a third argument per connection, which
          controls whether stop and start slave should be issued.
      
        - Added some comments to the file.
      
      rpl_row_img_sanity_set_img
      
        - Removed as it became obsolete after refactorings on
          rpl_row_img_set.
      
      rpl_row_img_sanity.test
       
        - Removed some comments (including ones referencing reviews).
        - Added assertion for default binlog_row_image
        - Refactored the main loop to be more descriptive
        - Reduced the code length by reusing rpl_row_img_sanity_set_img.inc
      
      rpl_row_img_general_loop.test
      
        - Changed so that the new argument for rpl_row_img_set.inc
          would be used. 
        - Improved comments.
      
      rpl_row_img_parts_assertion.inc
      
        - This was rpl_row_mysqbinlog_img_check.inc. Got renamed.
        - Refactored to:
          1. make image expected argument to be more concise;
          2. make it call mysqlbinlog itself and has start position as
             an argument. This way we can have mysqlbinlog to dump just
             a specific part of the binary log and reduce the scope of
             the pattern matching used in the assertion;
          3. to clean up error reporting.
        - Improved comments.
      
      rpl_row_img_parts_master_slave.inc
      
        - New file.
        - Wrapper to rpl_row_img_parts_assertion that handles
          replication scenarios, combining master and slave assertions
          together. It also handles automatic synchronization before
          executing the statement that generates row events, saves the
          binary log positions and in the end calls
          rpl_row_img_parts_assertion for both master and slave
          assertions.
      
      rpl_row_img_sanity_assertions.inc
      
        - Removed and merged remains on rpl_row_img_sanity.
      
      rpl_row_img_sanity_create_table
      
        - Removed and merged remains on rpl_row_img_sanity.
      
      rpl_row_img_sanity.test
      
        - After the refactorings above, replaced the obsolete parts
          with the new functionality. 
        - Improved comments.
      
      rpl_auto_increment
      
        - Was missing a "connection master" on the clean up section.
          Since diff_tables.inc now restores the connection to the one
          it was using before finishing, this means that the clean up
          commands were being issued on the slave's connection, whereas
          before they were issued on the master's connection.
      
      This commit also includes the corresponding result file updates.

    removed:
      mysql-test/extra/rpl_tests/rpl_row_record_find.test
      mysql-test/include/diff_tables2.inc
      mysql-test/suite/rpl/include/rpl_row_img_sanity_assertions.inc
      mysql-test/suite/rpl/include/rpl_row_img_sanity_create_table.inc
      mysql-test/suite/rpl/include/rpl_row_img_sanity_set_img.inc
      mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result
      mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test
    added:
      mysql-test/suite/rpl/include/rpl_row_img_parts_master_slave.inc
    renamed:
      mysql-test/suite/rpl/include/rpl_row_img_general_loop.test => mysql-test/suite/rpl/include/rpl_row_img_general_loop.inc
      mysql-test/suite/rpl/include/rpl_row_mysqbinlog_img_check.inc => mysql-test/suite/rpl/include/rpl_row_img_parts_assertion.inc
    modified:
      mysql-test/extra/rpl_tests/rpl_auto_increment.test
      mysql-test/extra/rpl_tests/rpl_row_img.test
      mysql-test/extra/rpl_tests/rpl_row_img_blobs.test
      mysql-test/extra/rpl_tests/rpl_row_img_diff_indexes.test
      mysql-test/include/diff_tables.inc
      mysql-test/suite/rpl/include/rpl_row_img_set.inc
      mysql-test/suite/rpl/r/rpl_row_img.result
      mysql-test/suite/rpl/r/rpl_row_img_sanity.result
      mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result
      mysql-test/suite/rpl/t/rpl_row_img.test
      mysql-test/suite/rpl/t/rpl_row_img_sanity.test
      mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test
      mysql-test/suite/rpl/include/rpl_row_img_general_loop.inc
      mysql-test/suite/rpl/include/rpl_row_img_parts_assertion.inc
=== modified file 'mysql-test/extra/rpl_tests/rpl_auto_increment.test'
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test	2009-09-10 10:05:53 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test	2010-03-26 11:09:50 +0000
@@ -237,6 +237,7 @@ let $diff_table_2= slave:test.t2;
 source include/diff_tables.inc;
 
 # End cleanup
+connection master;
 DROP TABLE t1;
 DROP TABLE t2;
 SET SQL_MODE='';

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_img.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_img.test	2009-11-25 11:59:17 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_img.test	2010-03-26 11:09:50 +0000
@@ -225,11 +225,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
 
   -- connection mysqld_a
@@ -242,11 +242,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- connection mysqld_a
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_img_blobs.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test	2009-11-25 11:59:17 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_img_blobs.test	2010-03-26 11:09:50 +0000
@@ -161,11 +161,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- connection mysqld_a
   -- eval DELETE FROM t WHERE c2=$blob1
@@ -176,11 +176,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- connection mysqld_a
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_img_diff_indexes.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_img_diff_indexes.test	2009-11-25 11:59:17 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_img_diff_indexes.test	2010-03-26 11:09:50 +0000
@@ -4,8 +4,7 @@
 #  ===========
 #
 #  This test case covers Requirements for different index structures
-#  on both master and slave. This covers requirements R1 and R4 from
-#  WL#5092, section "Index Structures".
+#  on both master and slave.
 #
 #  Usage
 #  =====
@@ -237,11 +236,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- connection mysqld_a
   -- eval DELETE FROM t WHERE c2=$blob1
@@ -252,11 +251,11 @@ while($i)
 
   -- let $diff_table_1=mysqld_a:$diff_table
   -- let $diff_table_2=mysqld_b:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- let $diff_table_1=mysqld_b:$diff_table
   -- let $diff_table_2=mysqld_c:$diff_table
-  -- source include/diff_tables2.inc
+  -- source include/diff_tables.inc
 
   -- connection mysqld_a
 

=== removed file 'mysql-test/extra/rpl_tests/rpl_row_record_find.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_record_find.test	2009-10-21 13:01:59 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_record_find.test	1970-01-01 00:00:00 +0000
@@ -1,173 +0,0 @@
-# USAGE:
-#   Before including this file the following variables should be set:
-#     * $master_engine
-#     * slave_engine
-#
-#   Example:
-#
-#     let $master_engine= Falcon;
-#     let $slave_engine= MyISAM;
-#
-#     -- source extra/rpl_tests/rpl_row_record_find.test
-# 
-
-
-connection master;
-
---disable_warnings
-DROP TABLE IF EXISTS t;
---enable_warnings
-
-sync_slave_with_master;
-connection master;
-
-let $i= 10;
-while($i)
-{
-  let $step= "";
-
-  connection master;
-  SET SQL_LOG_BIN=0;
-
-  if (`SELECT $i=1`) {
-    let $step= No keys ($master_engine -> $slave_engine);
-    --echo ******* TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= $slave_engine;
-  }
-  if (`SELECT $i=2`)
-  { 
-    let $step= One key ($master_engine -> $slave_engine);
-    --echo ******* TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= $slave_engine;
-  }
-  if (`SELECT $i=3`)
-  {
-    let $step= One Composite key ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=4`)
-  {
-    let $step= One Unique key ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=5`)
-  {
-    let $step= One Composite Unique key ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=6`)
-  {
-    let $step= One Primary key ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=7`)
-  {
-    let $step= One Composite Primary Key ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= $slave_engine;
-  } 
-  if (`SELECT $i=8`)
-  {
-    let $step= One Composite key with holes ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=9`)
-  {
-    let $step= One Composite Unique key with holes ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= $slave_engine;
-  }  
-  if (`SELECT $i=10`)
-  {
-    let $step= One Composite Primary Key with holes ($master_engine -> $slave_engine);
-    --echo ****** TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= $slave_engine;
-  } 
-  if (`SELECT $i=11`)
-  { 
-    let $step= One key ($master_engine -> $slave_engine);
-    --echo ******* TEST: $step
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c4)) engine= $master_engine;
-    connection slave;
-    --eval CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c4)) engine= $slave_engine;
-  }
-
-
-  connection master;
-  SET SQL_LOG_BIN=1;
-
-  connection master;
-  INSERT INTO t VALUES (1, '1', '1', '1' );
-  INSERT INTO t VALUES (4, '4', '4', '4' );
-  INSERT INTO t VALUES (7, '7', '7', '7' );
-
-  INSERT INTO t VALUES (9, '9', '9', NULL );
-
-  INSERT INTO t VALUES (2, '1', '2', '2' );
-  INSERT INTO t VALUES (3, '1', '3', '2' );
- 
-  sync_slave_with_master;
-
-  connection master;
-  UPDATE t SET c4 = '7';
-
-  UPDATE t SET c4 = '5' WHERE c1 = 1;
-  UPDATE t SET c2 = '5' WHERE c1 = 1;
-  UPDATE t SET c1 = '5' WHERE c1 = 1;
-
-  UPDATE t SET c4 = '8' WHERE c2 = '4';
-  UPDATE t SET c1 = '8' WHERE c2 = '4';
-  UPDATE t SET c2 = '8' WHERE c2 = '4';
-
-  UPDATE t SET c3 = '0' WHERE c4 = NULL;
-  UPDATE t SET c2 = '0' WHERE c4 = '0';
-
-  UPDATE t SET c2 = '2' WHERE c4 = '2';
-
-  sync_slave_with_master;
-
-  let $diff_table_1=master:test.t;
-  let $diff_table_2=slave:test.t;
-  source include/diff_tables.inc;
-
-  connection master;
-  DELETE FROM t WHERE c1 = 7;
-  DELETE FROM t WHERE c1 = 8;
-  DELETE FROM t;
-
-  sync_slave_with_master;
-
-  let $diff_table_1=master:test.t;
-  let $diff_table_2=slave:test.t;
-  source include/diff_tables.inc;
-
-  DROP TABLE t;
-  sync_slave_with_master;
-
-  dec $i;
-}

=== modified file 'mysql-test/include/diff_tables.inc'
--- a/mysql-test/include/diff_tables.inc	2009-05-21 20:03:53 +0000
+++ b/mysql-test/include/diff_tables.inc	2010-03-26 11:09:50 +0000
@@ -1,7 +1,7 @@
 # ==== Purpose ====
 #
-# Check if the two given tables (possibly residing on different
-# master/slave servers) are equal.
+# Check if the two given tables (possibly accessed through different
+# connections) are equal.
 #
 # ==== Usage ====
 #
@@ -9,13 +9,15 @@
 # $diff_table_1 and $diff_table_2.  They must be of the
 # following form:
 #
-#  [master:|slave:]database.table
+#  [connection_name:]database.table
 #
-# I.e., both database and table must be speicified.  Optionally, you
-# can prefix the name with 'master:' (to read the table on master) or
-# with 'slave:' (to read the table on slave).  If no prefix is given,
-# reads the table from the current connection.  If one of these
-# variables has a prefix, both should have a prefix.
+# I.e., both database and table must be specified.  Optionally, you
+# can prefix the table FQ name with the name of a connection, eg
+# 'master:test.t'. If a connection prefix is provided, we read the
+# table from it.  If no prefix is given, we read the table from the
+# connection in use at the time diff_tables.inc was included. Setting
+# a connection_name is not mandatory and we even support setting it on
+# just one parameter.
 #
 # ==== Side effects ====
 #
@@ -25,12 +27,6 @@
 #   system-specific format (unified diff if supported) and generates
 #   an error.
 #
-# - If $diff_table_1 or $diff_table_2 begins with 'master:' or
-#   'slave:', it will stay connected to one of those hosts after
-#   execution.  The host is only guaranteed to remain unchanged if
-#   none of $diff_table_1 or $diff_table_2 begins with 'master:' or
-#   'slave:'.
-#
 # ==== Bugs ====
 #
 # - It is currently not possible to use this for tables that are
@@ -55,26 +51,47 @@
 --echo Comparing tables $diff_table_1 and $diff_table_2
 disable_query_log;
 
+# saves old connection so that we can restore at the end
+-- let $old_connection= $CURRENT_CONNECTION
+
 --error 0,1
 --remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
 --error 0,1
 --remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
 
-let $_diff_table=$diff_table_2;
+# sets connections to current and later we change if needed
+-- let $conn1= $CURRENT_CONNECTION
+-- let $conn2= $CURRENT_CONNECTION
+-- let $tbl1= $diff_table_1
+-- let $tbl2= $diff_table_2
+
+# if a connection prefix was provided for table 1, we parse it
+# and update the connection and table variables
+if (`SELECT '$diff_table_1' LIKE '_%:_%'`)
+{
+  -- let $conn1= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', 1)`
+  -- let $tbl1= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', -1)`
+}
+
+# if a connection prefix was provided for table 2, we parse it
+# and update the connection and table variables
+if (`SELECT '$diff_table_2' LIKE '_%:_%'`)
+{
+  -- let $conn2= `SELECT SUBSTRING_INDEX('$diff_table_2', ':', 1)`
+  -- let $tbl2= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', -1)`
+}
+
+let $_diff_table=$tbl2;
 let $_diff_i=2;
+let $_connection_name=$conn2;
 while ($_diff_i) {
 
-  # Parse out any leading "master:" or "slave:" from the table
-  # specification and connect the appropriate server.
-  let $_diff_conn_master=`SELECT SUBSTR('$_diff_table', 1, 7) = 'master:'`;
-  if ($_diff_conn_master) {
-    let $_diff_table=`SELECT SUBSTR('$_diff_table', 8)`;
-    connection master;
-  }
-  let $_diff_conn_slave=`SELECT SUBSTR('$_diff_table', 1, 6) = 'slave:'`;
-  if ($_diff_conn_slave) {
-    let $_diff_table=`SELECT SUBSTR('$_diff_table', 7)`;
-    connection slave;
+  # we need to check whether the current connection name matches the
+  # one provided in the current parameter. If it does not, then we
+  # switch the connection
+  if (`SELECT STRCMP('$CURRENT_CONNECTION', '$_connection_name')=0`)
+  {
+    -- connection $_connection_name
   }
 
   # Sanity-check the input.
@@ -108,7 +125,8 @@ while ($_diff_i) {
 
   # Do the same for $diff_table_1.
   dec $_diff_i;
-  let $_diff_table=$diff_table_1;
+  let $_diff_table=$tbl1;
+  let $_connection_name= $conn1;
 }
 
 
@@ -119,4 +137,6 @@ diff_files $MYSQLTEST_VARDIR/tmp/diff_ta
 --remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
 --remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
 
+-- connection $old_connection
+
 enable_query_log;

=== removed file 'mysql-test/include/diff_tables2.inc'
--- a/mysql-test/include/diff_tables2.inc	2009-11-25 11:59:17 +0000
+++ b/mysql-test/include/diff_tables2.inc	1970-01-01 00:00:00 +0000
@@ -1,142 +0,0 @@
-# ==== Purpose ====
-#
-# Check if the two given tables (possibly accessed through different
-# connections) are equal.
-#
-# ==== Usage ====
-#
-# The tables to check are given by the test language variables
-# $diff_table_1 and $diff_table_2.  They must be of the
-# following form:
-#
-#  [connection_name:]database.table
-#
-# I.e., both database and table must be specified.  Optionally, you
-# can prefix the table FQ name with the name of a connection, eg
-# 'master:test.t'. If a connection prefix is provided, we read the
-# table from it.  If no prefix is given, we read the table from the
-# connection in use at the time diff_tables.inc was included. Setting
-# a connection_name is not mandatory and we even support setting it on
-# just one parameter.
-#
-# ==== Side effects ====
-#
-# - Prints "Comparing tables $diff_table_1 and $diff_tables_2".
-#
-# - If the tables are different, prints the difference in a
-#   system-specific format (unified diff if supported) and generates
-#   an error.
-#
-# ==== Bugs ====
-#
-# - It is currently not possible to use this for tables that are
-#   supposed to be different, because if the files are different:
-#    - 'diff' produces system-dependent output,
-#    - the output includes the absolute path of the compared files,
-#    - the output includes a timestamp.
-#   To fix that, we'd probably have to use SQL to compute the
-#   symmetric difference between the tables.  I'm not sure how to do
-#   that efficiently.  If we implement this, it would be nice to
-#   compare the table definitions too.
-#
-# - It actually compares the result of "SELECT * FROM table ORDER BY
-#   col1, col2, ..., colN INTO OUTFILE 'file'".  Hence, it is assumed
-#   that the comparison orders for both tables are equal and that two
-#   rows that are equal in the comparison order cannot differ, e.g.,
-#   by character case.
-
-
-# ==== Save both tables to file ====
-
---echo Comparing tables $diff_table_1 and $diff_table_2
-disable_query_log;
-
-# saves old connection so that we can restore at the end
--- let $old_connection= $CURRENT_CONNECTION
-
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
---error 0,1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
-
-# sets connections to current and later we change if needed
--- let $conn1= $CURRENT_CONNECTION
--- let $conn2= $CURRENT_CONNECTION
--- let $tbl1= $diff_table_1
--- let $tbl2= $diff_table_2
-
-# if a connection prefix was provided for table 1, we parse it
-# and update the connection and table variables
-if (`SELECT '$diff_table_1' LIKE '_%:_%'`)
-{
-  -- let $conn1= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', 1)`
-  -- let $tbl1= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', -1)`
-}
-
-# if a connection prefix was provided for table 2, we parse it
-# and update the connection and table variables
-if (`SELECT '$diff_table_2' LIKE '_%:_%'`)
-{
-  -- let $conn2= `SELECT SUBSTRING_INDEX('$diff_table_2', ':', 1)`
-  -- let $tbl2= `SELECT SUBSTRING_INDEX('$diff_table_1', ':', -1)`
-}
-
-let $_diff_table=$tbl2;
-let $_diff_i=2;
-let $_connection_name=$conn2;
-while ($_diff_i) {
-
-  # we need to check whether the current connection name matches the
-  # one provided in the current parameter. If it does not, then we
-  # switch the connection
-  if (`SELECT STRCMP('$CURRENT_CONNECTION', '$_connection_name')=0`)
-  {
-    -- connection $_connection_name
-  }
-
-  # Sanity-check the input.
-  let $_diff_error= `SELECT '$_diff_table' NOT LIKE '_%._%'`;
-  if ($_diff_error) {
-    --echo !!!ERROR IN TEST: \$diff_table_$_diff_i='$_diff_table' is not in the form database.table
-    exit;
-  }
-
-  # We need the output files to be sorted (so that diff_files does not
-  # think the files are different just because they are differently
-  # ordered).  To this end, we first generate a query that sorts the
-  # table by all columns.  Since ORDER BY accept column indices, we
-  # just generate a comma-separated list of all numbers from 1 to the
-  # number of columns in the table.
-  let $_diff_column_index=`SELECT MAX(ordinal_position)
-                           FROM information_schema.columns
-                           WHERE CONCAT(table_schema, '.', table_name) =
-                                 '$_diff_table'`;
-  let $_diff_column_list=$_diff_column_index;
-  dec $_diff_column_index;
-  while ($_diff_column_index) {
-    let $_diff_column_list=$_diff_column_index, $_diff_column_list;
-    dec $_diff_column_index;
-  }
-
-  # Now that we have the comma-separated list of columns, we can write
-  # the table to a file.
-  eval SELECT * FROM $_diff_table ORDER BY $_diff_column_list
-              INTO OUTFILE '$MYSQLTEST_VARDIR/tmp/diff_table_$_diff_i';
-
-  # Do the same for $diff_table_1.
-  dec $_diff_i;
-  let $_diff_table=$tbl1;
-  let $_connection_name= $conn1;
-}
-
-
-# ==== Compare the generated files ====
-
-diff_files $MYSQLTEST_VARDIR/tmp/diff_table_1 $MYSQLTEST_VARDIR/tmp/diff_table_2;
-
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_1
---remove_file $MYSQLTEST_VARDIR/tmp/diff_table_2
-
--- connection $old_connection
-
-enable_query_log;

=== renamed file 'mysql-test/suite/rpl/include/rpl_row_img_general_loop.test' => 'mysql-test/suite/rpl/include/rpl_row_img_general_loop.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_general_loop.test	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_general_loop.inc	2010-03-26 11:09:50 +0000
@@ -1,11 +1,21 @@
 #
-# This file takes a parameter as an argument:
-#  $row_img_test_script
+# This is a helper script for rpl_row_img.test. It creates
+# all combinations MyISAM / InnoDB in a three server replication 
+# chain. Each engine combination is tested against the three 
+# different values for binlog_row_image (same on every server).
 # 
-# It should hold the name of the script to run
-# with the given combinations 
+# The test script that is executed on every combination is the
+# only argument to this wrapper script. See below.
+# 
+# This script takes one parameter:
+#  - $row_img_test_script
+#    the name of the test script to include in every combination
+#
+# Sample usage:
+#   -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
+#   -- source suite/rpl/include/rpl_row_img_general_loop.test
 
--- let $row_image_param= 'FULL'
+-- let $row_img_set=mysqld_a:FULL:N,mysqld_b:FULL:Y,mysqld_c:FULL:Y
 -- source suite/rpl/include/rpl_row_img_set.inc
 
 -- let $image_param_ctr= 3
@@ -14,13 +24,13 @@ while($image_param_ctr)
 
   if (`SELECT $image_param_ctr = 2`)
   {
-    -- let $row_image_param= 'NOBLOB'
+    -- let $row_img_set=mysqld_a:NOBLOB:N,mysqld_b:NOBLOB:Y,mysqld_c:NOBLOB:Y
     -- source suite/rpl/include/rpl_row_img_set.inc
   }
 
   if (`SELECT $image_param_ctr = 1`)
   {
-    -- let $row_image_param= 'MINIMAL'
+    -- let $row_img_set=mysqld_a:MINIMAL:N,mysqld_b:MINIMAL:Y,mysqld_c:MINIMAL:Y
     -- source suite/rpl/include/rpl_row_img_set.inc
   }
 
@@ -55,6 +65,5 @@ while($image_param_ctr)
   -- dec $image_param_ctr
 }
 
--- let $row_image_param= 'FULL'
+-- let $row_img_set=mysqld_a:FULL:N,mysqld_b:FULL:Y,mysqld_c:FULL:Y
 -- source suite/rpl/include/rpl_row_img_set.inc
-

=== renamed file 'mysql-test/suite/rpl/include/rpl_row_mysqbinlog_img_check.inc' => 'mysql-test/suite/rpl/include/rpl_row_img_parts_assertion.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_mysqbinlog_img_check.inc	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_parts_assertion.inc	2010-03-26 11:09:50 +0000
@@ -1,87 +1,112 @@
--- perl END_OF_FILE
+# 
+# This is an include file that performs some assertions
+# on behalf of rpl_row_img_sanity test case.
+#
+# It begins by dumping the current connection binary log
+# and then compares it against the expected values (which
+# are parameters to this include) 
+#
+# Expected values are arguments to this script and must be structured
+# as follows:
+#
+#  -- let $row_img_expected= 1:1 2:2 3:'a' 4:NULL | 1:2 4:10
+#
+# This example means that BEFORE IMAGE contains values for columns
+# with the given index in the original table 1, 2, 3, 4 and their
+# values are 1,2,'a',NULL respectively.
+#
+# The same resoning for the AFTER IMAGE that follows the image
+#  separator char '|'.
+#
+# Arguments:
+#
+#  - $row_img_expected 
+#    The expected values for BI and AI that we are searching for
+#  - $row_img_pos
+#    The start position in the binary log from which the searching
+#    will be done
+#
+# Sample usage:
+#
+#   -- let $row_img_expected= 1:1 2:2 3:'a' 4:NULL | 1:2 4:10
+#   -- let $row_img_pos= 107
+#   -- source suite/rpl/include/rpl_row_img_parts_assertion.inc
+#  
 
-sub match_imgs
+if (`SELECT LENGTH("$row_img_pos") = 0`)
 {
-  my ($contents, $ai_ref, $bi_ref, $stmt_type) = @_;
+  -- echo $row_img_pos not defined: $row_img_pos
+  -- die Baiing out!
+}
 
-  my $match= 0;
-  my $error= 0;
+if (`SELECT LENGTH("$row_img_expected") = 0`)
+{
+  -- echo \$row_img_expected not defined: $row_img_expected
+  -- die Baiing out!
+}
 
-  %ai= %{$ai_ref};
-  %bi= %{$bi_ref};
+-- let $_prefix= `SELECT UUID()`
+-- let $TMP_FILE= $MYSQLTEST_VARDIR/tmp/$_prefix.tmp
 
-  my $composed_bi= "";
-  for my $k (sort (keys(%bi)))
-  {
-    $composed_bi = $composed_bi . "###   \@$k=" . $bi{$k} . "\n";
-  }
+-- let $binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+-- let $MYSQLD_DATADIR= `select @@datadir;`
+-- exec $MYSQL_BINLOG -v --start-pos=$row_img_pos $MYSQLD_DATADIR/$binlog > $TMP_FILE
 
-  my $composed_ai= "";
-  for my $k (sort (keys(%ai)))
-  {
-    $composed_ai = $composed_ai . "###   \@$k=" . $ai{$k} . "\n";
-  }
+-- let IMG_EXPECTED=$row_img_expected
+-- let IMG_BINLOG_FILE= $TMP_FILE
 
-  if($stmt_type=~/INSERT/)
-  {
-    $match= ($contents =~ /### INSERT.*\n### SET\n$composed_ai# at/m) ? 1 : 0;
-  }
-  elsif ($stmt_type=~/UPDATE/)
-  {
-    $match= ($contents =~ /### UPDATE.*\n### WHERE\n$composed_bi### SET\n$composed_ai# at/m) ? 1 : 0;
-  }
-  elsif ($stmt_type=~/DELETE/)
-  {
-    $match= ($contents =~ /### DELETE.*\n### WHERE\n$composed_bi# at/m) ? 1 : 0;
-  }
-  else
-  {
-    $error= 1;
-  }
+-- perl END_OF_FILE
+
+my $img = $ENV{'IMG_EXPECTED'};
+my $file= $ENV{'IMG_BINLOG_FILE'};
 
-  if ($error)
+open(FILE, $file) or die("Unable to open $binlog: $!\n");
+my $contents = do { local $/; <FILE> };
+close(FILE) or die("Unable to close file.");
+
+# Save IMG_EXPECTED in $img and check if it has correct format
+$img =~ /^([0-9]+:\S+ )* *\| *( [0-9]+:\S+)*$/ or \
+        die "Invalid format of IMG_EXPECTED parameter. GOT: '$img'";
+
+# Turn $img into the format of the binlog, and get BI and AI
+$img =~ s/ *([0-9]+):(\S*) */###   \@$1=$2\n/g;
+my ($bi, $ai)= split(/ *\| */, $img);
+# Generate regular expression
+if ($ai)
+{
+  if ($bi)
   {
-    print "Unexpected statement type: $stmt_type.\n"
+    $pattern= "### UPDATE.*\n### WHERE\n$bi### SET\n$ai";
   }
-
-  if (!$match)
+  else
   {
-    print "Unexpected columns in $stmt_type.\n";
-    print "EXPECTED BEFORE IMAGE:\n$composed_bi\nEXPECTED AFTER IMAGE:\n$composed_ai\nBINLOG CONTENTS:" . $contents;
+    $pattern= "### INSERT.*\n### SET\n$ai";
   }
-
-  return $match;
-}
-
-
-my $ai;
-my $bi;
-
-if (not defined $ENV{'IMG_AI_EXPECTED'})
-{
-  $ai= {};
 }
 else
 {
-  $ai= eval ($ENV{'IMG_AI_EXPECTED'}) or die("Invalid AI parameter: ".  $ENV{'IMG_AI_EXPECTED'});
+    $pattern= "### DELETE.*\n### WHERE\n$bi";
 }
+$match= ($contents =~ /$pattern/);
 
-if (not defined $ENV{'IMG_BI_EXPECTED'})
-{
-  $bi= {};
-}
-else
+if (!$match)
 {
-  $bi= eval ($ENV{'IMG_BI_EXPECTED'}) or die("Invalid BI parameter: ".  $ENV{'IMG_BI_EXPECTED'});
+  print "====================================================\n";
+  print "PATTERN FOR EXPECTED IMAGES DID NOT MATCH:\n";
+  print "====================================================\n";
+  print "$pattern";
+  print "====================================================\n\n";
+
+  print "====================================================\n";
+  print "BINLOG CONTENTS\n";
+  print "====================================================\n";
+  print "$contents";
+  print "====================================================\n";
 }
 
-my $binlog= $ENV{'IMG_BINLOG_FILE'};
-my $stmt_type= $ENV{'IMG_STMT_TYPE'};
+END_OF_FILE
 
-open(FILE, "$binlog") or die("Unable to open $binlog: $!\n");
-my $contents = do { local $/; <FILE> };
-close(FILE) or die("Unable to close file.");
+-- let IMG_EXPECTED= 
 
-match_imgs($contents, $ai, $bi, $stmt_type);
+-- remove_file $TMP_FILE
 
-END_OF_FILE

=== added file 'mysql-test/suite/rpl/include/rpl_row_img_parts_master_slave.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_parts_master_slave.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_parts_master_slave.inc	2010-03-26 11:09:50 +0000
@@ -0,0 +1,78 @@
+#
+# This is a wrapper to help minimize writing of assertions
+# that resort to rpl_row_img_parts_assertion.inc on a 
+# master-slave scenario.
+#
+# This script takes a statement to be executed and master
+# and slave expected images description as parameters. Before
+# statement execution (on the master only), both servers are
+# synchronized, and positions explicitly saved. These are
+# then used as starting position in mysqlbinlog -v (see
+# suite/rpl/include/rpl_row_img_parts_assertion.inc).
+# 
+# Parameters:
+#  - $row_img_query
+#    The query to be executed on the master, which will
+#    make master and slave log one or more row events.
+#
+#  - $row_img_expected_master
+#    String representation of the expected images to search
+#    on master's mysqlbinlog -v output
+#
+#  - $row_img_expected_slave
+#    String representation of the expected images to search
+#    on slaves's mysqlbinlog -v output
+#
+# Sample usage:
+#
+#  -- let $row_img_query= INSERT INTO t VALUES (1, 2, 3)
+#  -- let $row_img_expected_master= | 1:1 2:2 3:3
+#  -- let $row_img_expected_slave = | 1:1 2:2 3:3
+#  -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+#
+#  -- let $row_img_query= UPDATE t SET c2= 4 WHERE c1=1
+#  -- let $row_img_expected_master= 1:1 | 2:4
+#  -- let $row_img_expected_slave = 1:1 2:2 3:3 | 1:1 2:4 3:3
+#  -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+#
+#  -- let $row_img_query= DELETE FROM t WHERE c2=4
+#  -- let $row_img_expected_master= 1:1 |
+#  -- let $row_img_expected_slave = 1:1 2:4 3:3 | 
+#  -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+#
+# NOTES:
+#
+#  1. Both master and slave are synchronized before execution
+#     of the query takes place
+#  
+#  2. original connection - the one in use before including
+#     this script - is restored at the end
+
+-- let $old_conn= $CURRENT_CONNECTION
+
+-- connection master
+-- sync_slave_with_master
+
+-- let $row_img_pos_slave= query_get_value(SHOW MASTER STATUS, Position, 1)
+
+-- connection master
+-- let $row_img_pos_master= query_get_value(SHOW MASTER STATUS, Position, 1)
+
+# execute the query
+-- connection master
+-- eval $row_img_query
+-- sync_slave_with_master
+
+# master assertion
+-- connection master
+-- let $row_img_expected= $row_img_expected_master
+-- let $row_img_pos= $row_img_pos_master
+-- source suite/rpl/include/rpl_row_img_parts_assertion.inc
+
+# slave assertion 
+-- connection slave
+-- let $row_img_expected= $row_img_expected_slave
+-- let $row_img_pos= $row_img_pos_slave
+-- source suite/rpl/include/rpl_row_img_parts_assertion.inc
+
+-- connection $old_conn

=== removed file 'mysql-test/suite/rpl/include/rpl_row_img_sanity_assertions.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_sanity_assertions.inc	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_sanity_assertions.inc	1970-01-01 00:00:00 +0000
@@ -1,147 +0,0 @@
--- let IMG_STMT_TYPE=
-
--- let $TMP_FILE= $MYSQLTEST_VARDIR/tmp/rpl_row_img_sanity.tmp
--- let IMG_BINLOG_FILE= $TMP_FILE
-
--- let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/$binlog_file > $TMP_FILE
-
-################################################################
--- let IMG_STMT_TYPE=INSERT
--- let IMG_BI_EXPECTED={};
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"};
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL" or @@binlog_row_image = "NOBLOB"`)
-{
-  -- let IMG_AI_EXPECTED={1=>10, 2=>NULL, 3=>"\'a\'"};
-}
-if  (`SELECT @@binlog_row_image = "MINIMAL"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>10, 3=>"\'a\'"};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL" or @@binlog_row_image = "NOBLOB"`)
-{
-  -- let IMG_AI_EXPECTED={1=>100, 2=>NULL, 3=>"\'a\'"};
-}
-if  (`SELECT @@binlog_row_image = "MINIMAL"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>100, 3=>"\'a\'"};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL"`)
-{
-  -- let IMG_AI_EXPECTED={1=>1000, 2=>NULL, 3=>NULL};
-} 
-if  (`SELECT @@binlog_row_image = "NOBLOB"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>1000, 2=>NULL};
-}
-if  (`SELECT @@binlog_row_image = "MINIMAL"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>1000};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL"`)
-{
-  -- let IMG_AI_EXPECTED={1=>10000, 2=>NULL, 3=>NULL};
-} 
-if  (`SELECT @@binlog_row_image = "NOBLOB"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>10000, 2=>NULL};
-}
-if  (`SELECT @@binlog_row_image = "MINIMAL"`)
-{ 
-  -- let IMG_AI_EXPECTED={1=>10000};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL" OR (SELECT $iteration < 4)`)
-{
-  -- let IMG_BI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"};
-}
-
-# noblob with pk + uk no nullable
-if (`SELECT @@binlog_row_image = "NOBLOB" AND (SELECT $iteration > 3)`)
-{
-  -- let IMG_BI_EXPECTED={1=>1, 2=>2};
-}
-
-if (`SELECT @@binlog_row_image = "MINIMAL" AND (SELECT $iteration > 3)`)
-{
-  -- let IMG_BI_EXPECTED={1=>1};
-}
-
-if (`SELECT @@binlog_row_image = "FULL"`)
-{
-  -- let IMG_AI_EXPECTED={1=>2, 2=>2, 3=>"\'a\'"};
-}
-
-if (`SELECT @@binlog_row_image = "NOBLOB"`)
-{
-  -- let IMG_AI_EXPECTED={1=>2, 2=>2};
-}
-
-if (`SELECT @@binlog_row_image = "MINIMAL"`)
-{
-  -- let IMG_AI_EXPECTED={1=>2};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
--- let IMG_STMT_TYPE=DELETE
--- let IMG_AI_EXPECTED={};
--- let IMG_BI_EXPECTED={};
-
-if (`SELECT @@binlog_row_image = "FULL" OR (SELECT $iteration < 4)`)
-{
-  -- let IMG_BI_EXPECTED={1=>2, 2=>2, 3=>"\'a\'"};
-}
-
-# noblob with pk + uk no nullable
-if (`SELECT @@binlog_row_image = "NOBLOB" AND (SELECT $iteration > 3)`)
-{
-  -- let IMG_BI_EXPECTED={1=>2, 2=>2};
-}
-
-if (`SELECT @@binlog_row_image = "MINIMAL" AND (SELECT $iteration > 3)`)
-{
-  -- let IMG_BI_EXPECTED={1=>2};
-}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
-################################################################
-
--- remove_file $TMP_FILE
-

=== removed file 'mysql-test/suite/rpl/include/rpl_row_img_sanity_create_table.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_sanity_create_table.inc	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_sanity_create_table.inc	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-SET SQL_LOG_BIN=0;
-
--- echo CREATING TABLE IN $CURRENT_CONNECTION
-
-if (`SELECT $iteration = 1`)
-{
-  CREATE TABLE t (c1 int, c2 int, c3 blob);
-}
-
-if (`SELECT $iteration = 2`)
-{
-  CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-}
-
-if (`SELECT $iteration = 3`)
-{
-  CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-}
-
-
-# UK NON null
-if (`SELECT $iteration = 4`)
-{
-  CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-}
-
-# PK
-if (`SELECT $iteration = 5`)
-{
-  CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-}
-
-if (`SELECT $iteration = 6`)
-{
-  if (`SELECT @@binlog_row_image='NOBLOB'`)
-  {
-    CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c3(512)));
-  }
-}
-
-SET SQL_LOG_BIN=1;

=== removed file 'mysql-test/suite/rpl/include/rpl_row_img_sanity_set_img.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_sanity_set_img.inc	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_sanity_set_img.inc	1970-01-01 00:00:00 +0000
@@ -1,69 +0,0 @@
--- let $old_con= $CURRENT_CONNECTION
-
-if (`SELECT $iteration = 1`)
-{
-  -- connection master
-  -- echo ON MASTER
-  # global so that flush tables restarts the 
-  # insert dealyed thread
-  SET GLOBAL binlog_row_image='FULL';
-  SET SESSION binlog_row_image='FULL';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-  FLUSH TABLES;
-
-  -- connection slave
-  -- echo ON SLAVE
-  # global so that SQL thread also gets the change
-  SET GLOBAL binlog_row_image='FULL';
-  SET SESSION binlog_row_image='FULL';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-}
-
-if (`SELECT $iteration = 2`)
-{
-  -- connection master
-  -- echo ON MASTER
-  # global so that flush tables restarts the 
-  # insert dealyed thread
-  SET GLOBAL binlog_row_image='NOBLOB';
-  SET SESSION binlog_row_image='NOBLOB';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-  FLUSH TABLES;
-
-  -- connection slave
-  -- echo ON SLAVE
-  # global so that SQL thread also gets the change
-  SET GLOBAL binlog_row_image='NOBLOB';
-  SET SESSION binlog_row_image='NOBLOB';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-
-
-}
-
-if (`SELECT $iteration = 3`)
-{
-
-  -- connection master
-  -- echo ON MASTER
-
-  # global so that flush tables restarts the 
-  # insert dealyed thread
-  SET GLOBAL binlog_row_image='MINIMAL';
-  SET SESSION binlog_row_image='MINIMAL';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-  FLUSH TABLES;
-
-  -- connection master
-  -- echo ON SLAVE
-
-  # global so that SQL thread also gets the change
-  SET GLOBAL binlog_row_image='MINIMAL';
-  SET SESSION binlog_row_image='MINIMAL';
-  SHOW VARIABLES LIKE 'binlog_row_image';
-}
-
--- connection slave
--- source include/stop_slave.inc
--- source include/start_slave.inc
-
--- connection $old_con

=== modified file 'mysql-test/suite/rpl/include/rpl_row_img_set.inc'
--- a/mysql-test/suite/rpl/include/rpl_row_img_set.inc	2009-10-29 17:06:50 +0000
+++ b/mysql-test/suite/rpl/include/rpl_row_img_set.inc	2010-03-26 11:09:50 +0000
@@ -1,24 +1,55 @@
--- connection mysqld_a
--- eval SET SESSION binlog_row_image= $row_image_param
--- eval SET GLOBAL binlog_row_image= $row_image_param
-FLUSH TABLES;
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- connection mysqld_b
--- eval SET SESSION binlog_row_image= $row_image_param
--- eval SET GLOBAL binlog_row_image= $row_image_param
--- source include/stop_slave.inc
--- source include/start_slave.inc
-FLUSH TABLES;
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- connection mysqld_c
--- eval SET SESSION binlog_row_image= $row_image_param
--- eval SET GLOBAL binlog_row_image= $row_image_param
--- source include/stop_slave.inc
--- source include/start_slave.inc
-FLUSH TABLES;
-SHOW VARIABLES LIKE 'binlog_row_image';
+#
+# This is an auxiliar script that sets the binlog-row-image
+# on a set of connections. These connections are passed as
+# a parameter to this script. Its format is the following:
+#
+#   <conid,value,Y_or_N>:[<conid,value,Y_or_N>:...]
+#
+# In detail:
+#
+#   conid   -- connection id (eg, master)
+#   value   -- binlog_row_image value to set (eg, FULL)
+#   Y_or_N  -- Issue stop and start slave (eg, Y) 
+# 
+# Sample usage:
+#
+#  -- let $row_img_set=master:FULL:N,slave:MINIMAL:Y
+#  -- source suite/rpl/include/rpl_row_img_set.inc
+#
+# Notes:
+#
+#   1. This script saves and restores the original connection that was
+#      in use at the time it was included.
 
--- connection mysqld_a
+-- let $old_conn= $CURRENT_CONNECTION
 
+while (`SELECT HEX('$row_img_set') != HEX('')`)
+{
+
+  -- let $tuple= `SELECT SUBSTRING_INDEX('$row_img_set', ',', 1)`
+
+  -- let $conn= `SELECT SUBSTRING_INDEX('$tuple', ':', 1)`
+  -- let $rimg= `SELECT SUBSTRING_INDEX(LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + 2)), ':', 1)`
+
+  -- let $is_slave_restart= `SELECT LTRIM(SUBSTRING('$tuple', LENGTH('$conn') + LENGTH('$rimg')+ 3))`
+
+  -- echo CON: '$conn', IMG: '$rimg', RESTART SLAVE: '$is_slave_restart'
+
+  -- connection $conn
+  -- eval SET SESSION binlog_row_image= '$rimg'
+  -- eval SET GLOBAL binlog_row_image= '$rimg'
+
+  if (`SELECT '$is_slave_restart' = 'Y'`)
+  {
+    -- source include/stop_slave.inc
+    -- source include/start_slave.inc
+  }
+
+  FLUSH TABLES;
+  SHOW VARIABLES LIKE 'binlog_row_image';
+
+  -- let $row_img_set= `SELECT LTRIM(SUBSTRING('$row_img_set', LENGTH('$tuple') + 2     ))`
+
+}
+
+-- connection $old_conn

=== modified file 'mysql-test/suite/rpl/r/rpl_row_img.result'
--- a/mysql-test/suite/rpl/r/rpl_row_img.result	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_img.result	2010-03-26 11:09:50 +0000
@@ -28,12 +28,14 @@ include/start_slave.inc
 # engines and binlog-row-image mixes                              #
 ###################################################################
 ###################################################################
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -42,6 +44,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -3331,12 +3334,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'NOBLOB', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_b', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -3345,6 +3350,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_c', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -6634,12 +6640,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'MINIMAL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_b', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -6648,6 +6656,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_c', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -9937,12 +9946,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -9951,6 +9962,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -9964,12 +9976,14 @@ binlog_row_image	FULL
 # engines and binlog-row-image mix for different index structures #
 ###################################################################
 ###################################################################
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -9978,6 +9992,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -13203,12 +13218,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'NOBLOB', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_b', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -13217,6 +13234,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_c', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -16442,12 +16460,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'MINIMAL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_b', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -16456,6 +16476,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_c', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -19681,12 +19702,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -19695,6 +19718,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -19708,12 +19732,14 @@ binlog_row_image	FULL
 # engines and binlog-row-image mixes for blobs                    #
 ###################################################################
 ###################################################################
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -19722,6 +19748,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -21147,12 +21174,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'NOBLOB', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_b', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -21161,6 +21190,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'mysqld_c', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'NOBLOB';
 SET GLOBAL binlog_row_image= 'NOBLOB';
 include/stop_slave.inc
@@ -22586,12 +22616,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'MINIMAL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_b', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -22600,6 +22632,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'mysqld_c', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'MINIMAL';
 SET GLOBAL binlog_row_image= 'MINIMAL';
 include/stop_slave.inc
@@ -24025,12 +24058,14 @@ DELETE FROM t;
 Comparing tables mysqld_a:test.t and mysqld_b:test.t
 Comparing tables mysqld_b:test.t and mysqld_c:test.t
 DROP TABLE t;
+CON: 'mysqld_a', IMG: 'FULL', RESTART SLAVE: 'N'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_b', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc
@@ -24039,6 +24074,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'mysqld_c', IMG: 'FULL', RESTART SLAVE: 'Y'
 SET SESSION binlog_row_image= 'FULL';
 SET GLOBAL binlog_row_image= 'FULL';
 include/stop_slave.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_row_img_sanity.result'
--- a/mysql-test/suite/rpl/r/rpl_row_img_sanity.result	2009-12-10 18:20:15 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_img_sanity.result	2010-03-26 11:09:50 +0000
@@ -5,71 +5,63 @@ reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
 call mtr.add_suppression("Slave: Can\'t find record in \'t\' Error_code: 1032");
-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;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name	Value
+binlog_row_image	FULL
 SET @old_binlog_row_image= @@binlog_row_image;
 SET @old_binlog_row_image= @@binlog_row_image;
 #####################################################
-# (S4-7) basic assertion that binlog_row_image='FULL' is the
-######################################################
+# basic assertion that binlog_row_image='FULL' is the
+# default 
+#####################################################
 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;
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
+CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
-include/stop_slave.inc
-include/start_slave.inc
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
 INSERT INTO t(c1,c3) VALUES (1, 'a');
-UPDATE t SET c1=2 WHERE c1=1;
-DELETE FROM t;
+UPDATE t SET c1=2 WHERE c1=1;;
+DELETE FROM t;;
 DROP TABLE t;
-ON MASTER
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
+SET @img_types= 'MINIMAL NOBLOB FULL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-ON SLAVE
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
-include/stop_slave.inc
-include/start_slave.inc
-ITERATIONS: row_img: 3, indexes: 5
+SET @index_types= 'UK-NOT-NULL PK UK K NONE';
+ITERATIONS: row_img: MINIMAL, indexes: UK-NOT-NULL
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL'
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -78,21 +70,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 3, indexes: 4
+ITERATIONS: row_img: MINIMAL, indexes: PK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'PK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -101,21 +87,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 3, indexes: 3
+ITERATIONS: row_img: MINIMAL, indexes: UK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -124,21 +104,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 3, indexes: 2
+ITERATIONS: row_img: MINIMAL, indexes: K
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
+CREATING TABLE IN master WITH INDEX 'K'
 CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
-CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -147,21 +121,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 3, indexes: 1
+ITERATIONS: row_img: MINIMAL, indexes: NONE
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'NONE'
 CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -170,36 +138,26 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ON MASTER
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
-SHOW VARIABLES LIKE 'binlog_row_image';
+CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N'
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-ON SLAVE
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
-include/stop_slave.inc
-include/start_slave.inc
-ITERATIONS: row_img: 2, indexes: 5
+SET @index_types= 'UK-NOT-NULL PK UK K NONE';
+ITERATIONS: row_img: NOBLOB, indexes: UK-NOT-NULL
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL'
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -208,21 +166,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 2, indexes: 4
+ITERATIONS: row_img: NOBLOB, indexes: PK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'PK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -231,21 +183,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 2, indexes: 3
+ITERATIONS: row_img: NOBLOB, indexes: UK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -254,21 +200,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 2, indexes: 2
+ITERATIONS: row_img: NOBLOB, indexes: K
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
+CREATING TABLE IN master WITH INDEX 'K'
 CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
-CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -277,21 +217,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 2, indexes: 1
+ITERATIONS: row_img: NOBLOB, indexes: NONE
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'NONE'
 CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -300,36 +234,26 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ON MASTER
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
+CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N'
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-ON SLAVE
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
-include/stop_slave.inc
-include/start_slave.inc
-ITERATIONS: row_img: 1, indexes: 5
+SET @index_types= 'UK-NOT-NULL PK UK K NONE';
+ITERATIONS: row_img: FULL, indexes: UK-NOT-NULL
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK-NOT-NULL'
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -338,21 +262,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 1, indexes: 4
+ITERATIONS: row_img: FULL, indexes: PK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'PK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -361,21 +279,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 1, indexes: 3
+ITERATIONS: row_img: FULL, indexes: UK
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
-CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
+CREATING TABLE IN master WITH INDEX 'UK'
 CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -384,21 +296,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 1, indexes: 2
+ITERATIONS: row_img: FULL, indexes: K
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
+CREATING TABLE IN master WITH INDEX 'K'
 CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
-CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -407,21 +313,15 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-ITERATIONS: row_img: 1, indexes: 1
+ITERATIONS: row_img: FULL, indexes: NONE
 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;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN master
+CREATING TABLE IN master WITH INDEX 'NONE'
 CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
-SET SQL_LOG_BIN=0;
-CREATING TABLE IN slave
-CREATE TABLE t (c1 int, c2 int, c3 blob);
-SET SQL_LOG_BIN=1;
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
 INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
@@ -431,36 +331,31 @@ UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
 ################## SPECIAL CASES #########################
-# the ones marked with (S#-#) are mentioned in review:
-# http://lists.mysql.com/commits/89844
 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;
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
+CON: 'master', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
-include/stop_slave.inc
-include/start_slave.inc
 ###################################
 # PK (contains blob)
 ###################################
-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;
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c3(512)));
 INSERT INTO t VALUES (1,2,"a");
 INSERT INTO t(c1,c3) VALUES (10,"a");
@@ -470,8 +365,6 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c1=2 WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-### checking master images
-### checking slave images
 ###################################
 # PK (does not contain blob, but blob is updated)
 ###################################
@@ -490,10 +383,8 @@ INSERT DELAYED INTO t(c1) VALUES (10000)
 UPDATE t SET c3='b' WHERE c1=1;
 DELETE FROM t WHERE c2=2;
 DROP TABLE t;
-### checking master images
-### checking slave images
 ###################################
-# (S4-1) AUTOINC columns
+# AUTOINC columns
 ###################################
 stop slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -501,30 +392,27 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
-include/stop_slave.inc
-include/start_slave.inc
-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;
 CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1,c2));
 INSERT INTO t(c2) VALUES (2);
 DROP TABLE t;
 ##################################################################
-# (S4-2) Test that slave does not write more columns than the ones it has 
+# Test that slave does not write more columns than the ones it has 
 ##################################################################
 stop slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -532,25 +420,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1,c2));
 SET SQL_LOG_BIN=1;
@@ -559,7 +444,7 @@ INSERT INTO t(c2,c3) VALUES (2,'aaaaa');
 UPDATE t SET c2=3, c3='bbbbb' WHERE c2=2;
 DROP TABLE t;
 ##################################################################
-# (S4-5) Test that slave fills default columns in its own columns
+# Test that slave fills default columns in its own columns
 ##################################################################
 stop slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -567,25 +452,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
+CON: 'master', IMG: 'FULL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int, c2 int);
 SET SQL_LOG_BIN=1;
@@ -602,7 +484,7 @@ c1	c2
 2	NULL
 DROP TABLE t;
 ##################################################################
-# (S4-6) Test that slave uses partial BI when master contains more columns
+# Test that slave uses partial BI when master contains more columns
 ##################################################################
 stop slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -610,25 +492,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1, c3), unique key(c1));
 SET SQL_LOG_BIN=1;
@@ -643,7 +522,7 @@ c1	c2	c3
 1	4	3
 DROP TABLE t;
 ##################################################################
-# (S4-3) Test that if master has binlog_row_image=MINIMAL and slave has 
+# Test that if master has binlog_row_image=MINIMAL and slave has 
 # NOBLOB or FULL, it will log the expected columns
 ##################################################################
 stop slave;
@@ -652,25 +531,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'FULL', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1));
 SET SQL_LOG_BIN=1;
@@ -685,25 +561,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1));
 SET SQL_LOG_BIN=1;
@@ -713,7 +586,7 @@ UPDATE t SET c2= 4 WHERE c1=1;
 DELETE FROM t WHERE c2=4;
 DROP TABLE t;
 ################################################################
-# (S4-4) Test that the slave stop with error if no usable data is on BI
+# Test that the slave stop with error if no usable data is on BI
 ################################################################
 stop slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
@@ -721,25 +594,22 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
+CON: 'master', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+SET SESSION binlog_row_image= 'MINIMAL';
+SET GLOBAL binlog_row_image= 'MINIMAL';
+FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
+CON: 'slave', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+SET SESSION binlog_row_image= 'NOBLOB';
+SET GLOBAL binlog_row_image= 'NOBLOB';
+include/stop_slave.inc
+include/start_slave.inc
 FLUSH TABLES;
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	NOBLOB
-include/stop_slave.inc
-include/start_slave.inc
-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;
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c3));
 SET SQL_LOG_BIN=1;
@@ -747,7 +617,6 @@ CREATE TABLE t (c1 int NOT NULL, c2 int,
 INSERT INTO t VALUES (1,2,3);
 UPDATE t SET c2=4 WHERE c2=2;
 DROP TABLE t;
-Could not execute Update_rows event on table test.t; Can't find record in 't', Error_code: 1032; handler error HA_ERR_END_OF_FILE; the event's master log master-bin.000001, end_log_pos 478
 include/stop_slave.inc
 DROP TABLE t;
 SET GLOBAL binlog_row_image= @old_binlog_row_image;

=== removed file 'mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result	2009-10-21 13:01:59 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_record_find_innodb.result	1970-01-01 00:00:00 +0000
@@ -1,828 +0,0 @@
-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;
-#################################################################
-# CASE 5: InnoDB - master, MyISAM - slave
-#################################################################
-DROP TABLE IF EXISTS t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key with holes (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key with holes (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key with holes (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Primary key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Unique key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: One key (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: No keys (InnoDB -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-#################################################################
-# CASE 6: InnoDB - master, InnoDB - slave
-#################################################################
-DROP TABLE IF EXISTS t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key with holes (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key with holes (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key with holes (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Primary key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Unique key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: One key (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: No keys (InnoDB -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-#################################################################
-# CASE 7: MyISAM - master, InnoDB - slave
-#################################################################
-DROP TABLE IF EXISTS t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key with holes (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key with holes (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key with holes (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Primary key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Unique key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: One key (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: No keys (MyISAM -> InnoDB)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result	2009-10-21 13:01:59 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_record_find_myisam.result	2010-03-26 11:09:50 +0000
@@ -12,277 +12,3 @@ CREATE TABLE table1_myisam ( `bit_key` b
 INSERT IGNORE INTO table1_myisam VALUES ('1', '-2146992385');
 UPDATE `table1_myisam` SET `bit_key` = 0 WHERE `bit_key` = 1;
 DROP TABLE table1_myisam;
-#################################################################
-# CASE 1: MyISAM - master, MyISAM - slave
-#################################################################
-DROP TABLE IF EXISTS t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key with holes (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key with holes (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key with holes (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Primary Key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Primary key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite Unique key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Unique key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-****** TEST: One Composite key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: One key (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;
-SET SQL_LOG_BIN=0;
-******* TEST: No keys (MyISAM -> MyISAM)
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
-CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
-SET SQL_LOG_BIN=1;
-INSERT INTO t VALUES (1, '1', '1', '1' );
-INSERT INTO t VALUES (4, '4', '4', '4' );
-INSERT INTO t VALUES (7, '7', '7', '7' );
-INSERT INTO t VALUES (9, '9', '9', NULL );
-INSERT INTO t VALUES (2, '1', '2', '2' );
-INSERT INTO t VALUES (3, '1', '3', '2' );
-UPDATE t SET c4 = '7';
-UPDATE t SET c4 = '5' WHERE c1 = 1;
-UPDATE t SET c2 = '5' WHERE c1 = 1;
-UPDATE t SET c1 = '5' WHERE c1 = 1;
-UPDATE t SET c4 = '8' WHERE c2 = '4';
-UPDATE t SET c1 = '8' WHERE c2 = '4';
-UPDATE t SET c2 = '8' WHERE c2 = '4';
-UPDATE t SET c3 = '0' WHERE c4 = NULL;
-UPDATE t SET c2 = '0' WHERE c4 = '0';
-UPDATE t SET c2 = '2' WHERE c4 = '2';
-Comparing tables master:test.t and slave:test.t
-DELETE FROM t WHERE c1 = 7;
-DELETE FROM t WHERE c1 = 8;
-DELETE FROM t;
-Comparing tables master:test.t and slave:test.t
-DROP TABLE t;

=== modified file 'mysql-test/suite/rpl/t/rpl_row_img.test'
--- a/mysql-test/suite/rpl/t/rpl_row_img.test	2009-11-25 11:59:17 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_img.test	2010-03-26 11:09:50 +0000
@@ -5,10 +5,7 @@
 #   In this file we will run tests that mix engines, indexes
 #   and blobs.
 #  
-#   They cover requirements (from WL#5092):
-#    R1-R6 - INDEXES
-#    R1,R2,R4 - BLOBS
-#    R1 - Logging requirements are checked in the rpl_row_img_sanity test.
+#   See WL#5096 for details.
 #
 -- source suite/rpl/include/rpl_chained_3_hosts.inc
 -- source include/have_binlog_format_row.inc
@@ -27,7 +24,7 @@
 -- echo ###################################################################
 -- echo ###################################################################
 -- let $row_img_test_script= extra/rpl_tests/rpl_row_img.test
--- source suite/rpl/include/rpl_row_img_general_loop.test
+-- source suite/rpl/include/rpl_row_img_general_loop.inc
 
 -- echo ###################################################################
 -- echo ###################################################################
@@ -35,7 +32,7 @@
 -- echo ###################################################################
 -- echo ###################################################################
 -- let $row_img_test_script= extra/rpl_tests/rpl_row_img_diff_indexes.test
--- source suite/rpl/include/rpl_row_img_general_loop.test
+-- source suite/rpl/include/rpl_row_img_general_loop.inc
 
 -- echo ###################################################################
 -- echo ###################################################################
@@ -43,4 +40,4 @@
 -- echo ###################################################################
 -- echo ###################################################################
 -- let $row_img_test_script= extra/rpl_tests/rpl_row_img_blobs.test
--- source suite/rpl/include/rpl_row_img_general_loop.test
+-- source suite/rpl/include/rpl_row_img_general_loop.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_row_img_sanity.test'
--- a/mysql-test/suite/rpl/t/rpl_row_img_sanity.test	2009-12-10 18:20:15 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sanity.test	2010-03-26 11:09:50 +0000
@@ -2,30 +2,23 @@
 #  Description
 #  ===========
 #
-#  This test case checks whether binlog files contain
-#  Before and After image values as expected.
-#
-#  Configuration is done using the --binlog-row-image
-#  variable.
+#  This test case checks whether binlog files contain Before and After
+#  image values as expected. Configuration is done using the
+#  --binlog-row-image variable.
 #
 #  How it works
 #  ============
 #
-#  The test case is implemented such that master and slave
-#  create a table with different types of keys. Then, deletes
-#  and updates are performed in the master. The resulting
-#  output of mysqlbinlog -v issued on the binlogs generated 
-#  is then searched for the pattern expected wrt before and 
-#  after images.
-#
-#  Some special cases are also considered. A small description
-#  for each one is provided inline.
+#  The test case is implemented such that master and slave basically
+#  hold the same table but sometimes differ in indexes, number of
+#  columns and data types constraints (autoinc). Then some statements
+#  are executed and the output of mysqlbinlog is parsed for the given
+#  event to check if the columns in the before and after image match
+#  expectations according to the binlog-row-image value on master and
+#  on slave.
 #
 #  See also WL#5096.
 #
-#  NOTE: cases marked with S#(-#) address review comments in:
-#        http://lists.mysql.com/commits/89844        
-
 -- source include/master-slave.inc
 -- source include/have_binlog_format_row.inc
 
@@ -33,10 +26,8 @@
 call mtr.add_suppression("Slave: Can\'t find record in \'t\' Error_code: 1032");
 -- connection master
 
--- let $TMP_FILE= $MYSQLTEST_VARDIR/tmp/rpl_row_img_sanity.tmp
--- let IMG_BINLOG_FILE= $TMP_FILE
-
--- source include/master-slave-reset.inc
+## assertion: check that default value for binlog-row-image == 'FULL'
+SHOW VARIABLES LIKE 'binlog_row_image';
 
 ## save original 
 -- connection master
@@ -46,249 +37,286 @@ SET @old_binlog_row_image= @@binlog_row_
 -- connection master
 
 -- echo #####################################################
--- echo # (S4-7) basic assertion that binlog_row_image='FULL' is the
--- echo ######################################################
+-- echo # basic assertion that binlog_row_image='FULL' is the
+-- echo # default 
+-- echo #####################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
-
--- connection master
+-- let $row_img_set=master:FULL:N,slave:FULL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
-INSERT INTO t(c1,c3) VALUES (1, 'a');
-UPDATE t SET c1=2 WHERE c1=1;
-DELETE FROM t;
-
--- sync_slave_with_master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>NULL, 3=>"\'a\'"}
--- let IMG_AI_EXPECTED={1=>2, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>2, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
 
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>NULL, 3=>"\'a\'"}
--- let IMG_AI_EXPECTED={1=>2, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t(c1,c3) VALUES (1, 'a')
+-- let $row_img_expected_master= | 1:1 2:NULL 3:'a'
+-- let $row_img_expected_slave = | 1:1 2:NULL 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c1=2 WHERE c1=1;
+-- let $row_img_expected_master= 1:1 2:NULL 3:'a' | 1:2 2:NULL 3:'a'
+-- let $row_img_expected_slave = 1:1 2:NULL 3:'a' | 1:2 2:NULL 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= DELETE FROM t;
+-- let $row_img_expected_master= 1:2 2:NULL 3:'a' |
+-- let $row_img_expected_slave = 1:2 2:NULL 3:'a' |
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>2, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
 DROP TABLE t;
 -- sync_slave_with_master
 
--- remove_file $TMP_FILE
-
-# S3 - make rpl_row_img_sanity more human readable.
 #
-# I have split these runs into iterations. Each iteration acts as a
-# parameter to the create table include file and the assertions
-# include file.
+# Assertions: combines img_types with different index types. 
+#             The checks that rows are logged with expected
+#             image contents, depending on the img_type.
 #
-# For this to work I also had to patch mysql-5.1-rep+2 with patch for 
-# BUG#48671 which will be in next-mr (so that we could use perl; inside 
-# while). Since this is targetting next-mr we can later null-merge for 
-# that piece of code.
 
 -- connection master
--- let $nloops_row_img=3
-while ($nloops_row_img)
+SET @img_types= 'MINIMAL NOBLOB FULL';
+while (`SELECT HEX(@img_types) != HEX('')`)
 {
-  -- let $iteration= $nloops_row_img
-  -- source suite/rpl/include/rpl_row_img_sanity_set_img.inc
+  -- disable_query_log
+  let $img_type= `SELECT SUBSTRING_INDEX(@img_types, ' ', 1)`;
+  -- let $row_img_set=master:$img_type:N,slave:$img_type:Y
+  -- source suite/rpl/include/rpl_row_img_set.inc
 
-  -- let $nloops_indexes= 5
-  while ($nloops_indexes)
+  SET @index_types= 'UK-NOT-NULL PK UK K NONE';
+  while (`SELECT HEX(@index_types) != HEX('')`)
   {
-    -- let $iteration= $nloops_indexes
+    -- disable_query_log
+    let $index_type= `SELECT SUBSTRING_INDEX(@index_types, ' ', 1)`;
+    -- enable_query_log
 
-    -- echo ITERATIONS: row_img: $nloops_row_img, indexes: $nloops_indexes
+    -- echo ITERATIONS: row_img: $img_type, indexes: $index_type
 
     -- source include/master-slave-reset.inc
     -- connection master
 
     # create the table
-    -- source suite/rpl/include/rpl_row_img_sanity_create_table.inc
-    -- connection slave
-    -- source suite/rpl/include/rpl_row_img_sanity_create_table.inc
+    -- echo CREATING TABLE IN $CURRENT_CONNECTION WITH INDEX '$index_type'
+
+    if (`SELECT HEX('$index_type') = HEX('NONE')`)
+    {
+      CREATE TABLE t (c1 int, c2 int, c3 blob);
+    }
+
+    if (`SELECT HEX('$index_type') = HEX('K')`)
+    {
+      CREATE TABLE t (c1 int, c2 int, c3 blob, key(c1));
+    }
+
+    if (`SELECT HEX('$index_type') = HEX('UK')`)
+    {
+      CREATE TABLE t (c1 int, c2 int, c3 blob, unique key(c1));
+    }
+
+    if (`SELECT HEX('$index_type') = HEX('PK')`)
+    {
+      CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1));
+    }
+
+    if (`SELECT HEX('$index_type') = HEX('UK-NOT-NULL')`)
+    {
+      CREATE TABLE t (c1 int NOT NULL, c2 int, c3 blob, unique key(c1));
+    }
+
+    -- sync_slave_with_master
     -- connection master
 
-    # issue some statements
-    INSERT INTO t VALUES (1,2,"a");
-    INSERT INTO t(c1,c3) VALUES (10,"a");
+    # Issue some statements
+
+    -- let $row_img_query= INSERT INTO t VALUES (1,2,"a")
+    -- let $row_img_expected_master= | 1:1 2:2 3:'a'
+    -- let $row_img_expected_slave = | 1:1 2:2 3:'a'
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+    -- let $row_img_query= INSERT INTO t(c1,c3) VALUES (10,"a")
+    if (`SELECT @@binlog_row_image = "FULL" or @@binlog_row_image = "NOBLOB"`)
+    {
+      -- let $row_img_expected_master= | 1:10 2:NULL 3:'a'
+    }
+    if  (`SELECT @@binlog_row_image = "MINIMAL"`)
+    {
+      -- let $row_img_expected_master= | 1:10 3:'a'
+    }
+    -- let $row_img_expected_slave= $row_img_expected_master
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
     # we need to test insert delayed to check if the thread handling
     # the delayed inserts also marks the correct write set (it has its
     # own sort of table object).
-    INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
-    INSERT INTO t(c1) VALUES (1000);
-    INSERT DELAYED INTO t(c1) VALUES (10000);
-    UPDATE t SET c1=2 WHERE c1=1;
-    DELETE FROM t WHERE c2=2;
+    -- let $row_img_query= INSERT DELAYED INTO t(c1,c3) VALUES (100,"a")
+    if (`SELECT @@binlog_row_image = "FULL" or @@binlog_row_image = "NOBLOB"`)
+    {
+      -- let $row_img_expected_master= | 1:100 2:NULL 3:'a'
+    }
+    if  (`SELECT @@binlog_row_image = "MINIMAL"`)
+    { 
+      -- let $row_img_expected_master= | 1:100 3:'a'
+    }
+    -- let $row_img_expected_slave= $row_img_expected_master
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+    -- let $row_img_query= INSERT INTO t(c1) VALUES (1000)
+    if (`SELECT @@binlog_row_image = "FULL"`)
+    {
+      -- let $row_img_expected_master= | 1:1000 2:NULL 3:NULL
+    } 
+    if  (`SELECT @@binlog_row_image = "NOBLOB"`)
+    { 
+      -- let $row_img_expected_master= | 1:1000 2:NULL
+    }
+    if  (`SELECT @@binlog_row_image = "MINIMAL"`)
+    { 
+      -- let $row_img_expected_master= | 1:1000
+    }
+    -- let $row_img_expected_slave= $row_img_expected_master
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+    -- let $row_img_query= INSERT DELAYED INTO t(c1) VALUES (10000)
+    if (`SELECT @@binlog_row_image = "FULL"`)
+    {
+      -- let $row_img_expected_master= | 1:10000 2:NULL 3:NULL
+    } 
+    if  (`SELECT @@binlog_row_image = "NOBLOB"`)
+    { 
+      -- let $row_img_expected_master= | 1:10000 2:NULL
+    }
+    if  (`SELECT @@binlog_row_image = "MINIMAL"`)
+    { 
+      -- let $row_img_expected_master= | 1:10000
+    }
+    -- let $row_img_expected_slave= $row_img_expected_master
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+    -- let $row_img_query= UPDATE t SET c1=2 WHERE c1=1
+    if (`SELECT @@binlog_row_image = "FULL" OR (SELECT '$index_type' IN ('NONE', 'K', 'UK'))`)
+    {
+      -- let $bi= 1:1 2:2 3:'a'
+    }
+
+    # noblob with pk + uk not nullable
+    if (`SELECT @@binlog_row_image = "NOBLOB" AND (SELECT '$index_type' IN ('PK', 'UK-NOT-NULL'))`)
+    {
+      -- let $bi= 1:1 2:2
+    }
+
+    if (`SELECT @@binlog_row_image = "MINIMAL" AND (SELECT '$index_type' IN ('PK', 'UK-NOT-NULL'))`)
+    {
+      -- let $bi= 1:1
+    }
+
+    if (`SELECT @@binlog_row_image = "FULL"`)
+    {
+      -- let $ai= 1:2 2:2 3:'a'
+    }
+
+    if (`SELECT @@binlog_row_image = "NOBLOB"`)
+    {
+      -- let $ai= 1:2 2:2
+    }
+
+    if (`SELECT @@binlog_row_image = "MINIMAL"`)
+    {
+      -- let $ai= 1:2
+    }
+    -- let $row_img_expected_master= $bi | $ai
+    -- let $row_img_expected_slave = $bi | $ai
+    -- let $ai=
+    -- let $bi=
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+    -- let $row_img_query= DELETE FROM t WHERE c2=2
+    # no key, simple key or unique key nullable
+    if (`SELECT @@binlog_row_image = "FULL" OR (SELECT '$index_type' IN ('NONE', 'K', 'UK'))`)
+    {
+      -- let $row_img_expected_master= 1:2 2:2 3:'a' |
+    }
+
+    # noblob with pk + uk not nullable
+    if (`SELECT @@binlog_row_image = "NOBLOB" AND (SELECT '$index_type' IN ('PK', 'UK-NOT-NULL'))`)
+    {
+      -- let $row_img_expected_master= 1:2 2:2 |
+    }
+
+    if (`SELECT @@binlog_row_image = "MINIMAL" AND (SELECT '$index_type' IN ('PK', 'UK-NOT-NULL'))`)
+    {
+      -- let $row_img_expected_master= 1:2 |
+    }
+    -- let $row_img_expected_slave= $row_img_expected_master
+    -- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
     DROP TABLE t;
 
     -- sync_slave_with_master
 
-    # check logged images
+    -- disable_query_log
     -- connection master
-    -- source suite/rpl/include/rpl_row_img_sanity_assertions.inc
-    -- connection slave
-    -- source suite/rpl/include/rpl_row_img_sanity_assertions.inc
+    -- eval SET @index_types= LTRIM(SUBSTRING(@index_types, LENGTH('$index_type') + 1))
+    -- enable_query_log
 
-    -- dec $nloops_indexes
   }
 
-  -- dec $nloops_row_img
+  -- disable_query_log
+  -- connection master
+  -- eval SET @img_types= LTRIM(SUBSTRING(@img_types, LENGTH('$img_type') + 1))
+  -- enable_query_log
 }
 
 -- echo ################## SPECIAL CASES #########################
--- echo # the ones marked with (S#-#) are mentioned in review:
--- echo # http://lists.mysql.com/commits/89844
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- connection master
+-- let $row_img_set=master:NOBLOB:N,slave:NOBLOB:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 -- echo ###################################
 -- echo # PK (contains blob)
 -- echo ###################################
 
--- source include/master-slave-reset.inc
 -- connection master
 
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c3(512)));
-INSERT INTO t VALUES (1,2,"a");
-INSERT INTO t(c1,c3) VALUES (10,"a");
-INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
-INSERT INTO t(c1) VALUES (1000);
-INSERT DELAYED INTO t(c1) VALUES (10000);
-UPDATE t SET c1=2 WHERE c1=1;
-DELETE FROM t WHERE c2=2;
-DROP TABLE t;
-
--- sync_slave_with_master
--- connection master
-
--- echo ### checking master images
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>100, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t VALUES (1,2,"a")
+-- let $row_img_expected_master= | 1:1 2:2 3:'a'
+-- let $row_img_expected_slave = | 1:1 2:2 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT INTO t(c1,c3) VALUES (10,"a")
+-- let $row_img_expected_master= | 1:10 2:NULL 3:'a'
+-- let $row_img_expected_slave = | 1:10 2:NULL 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT DELAYED INTO t(c1,c3) VALUES (100,"a")
+-- let $row_img_expected_master= | 1:100 2:NULL 3:'a'
+-- let $row_img_expected_slave = | 1:100 2:NULL 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT INTO t(c1) VALUES (1000)
+-- let $row_img_expected_master= | 1:1000 2:NULL
+-- let $row_img_expected_slave = | 1:1000 2:NULL
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT DELAYED INTO t(c1) VALUES (10000)
+-- let $row_img_expected_master= | 1:10000 2:NULL
+-- let $row_img_expected_slave = | 1:10000 2:NULL
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c1=2 WHERE c1=1
+-- let $row_img_expected_master= 1:1 2:2 3:'a' | 1:2 2:2
+-- let $row_img_expected_slave = 1:1 2:2 3:'a' | 1:2 2:2
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= DELETE FROM t WHERE c2=2
+-- let $row_img_expected_master= 1:2 2:2 3:'a' | 
+-- let $row_img_expected_slave = 1:2 2:2 3:'a' | 
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1000, 2=>NULL}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10000, 2=>NULL}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- let IMG_AI_EXPECTED={1=>2, 2=>2}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>2, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- remove_file $TMP_FILE
-
--- connection slave
--- echo ### checking slave images
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>100, 2=>NULL, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1000, 2=>NULL}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10000, 2=>NULL}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- let IMG_AI_EXPECTED={1=>2, 2=>2}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>2, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+DROP TABLE t;
 
--- remove_file $TMP_FILE
+-- sync_slave_with_master
 
 -- echo ###################################
 -- echo # PK (does not contain blob, but blob is updated)
@@ -298,159 +326,72 @@ DROP TABLE t;
 -- connection master
 
 CREATE TABLE t (c1 int, c2 int, c3 blob, primary key(c1,c2));
-INSERT INTO t VALUES (1,2,"a");
-INSERT INTO t(c1,c3) VALUES (10,"a");
-INSERT DELAYED INTO t(c1,c3) VALUES (100,"a");
-INSERT INTO t(c1) VALUES (1000);
-INSERT DELAYED INTO t(c1) VALUES (10000);
-UPDATE t SET c3='b' WHERE c1=1;
-DELETE FROM t WHERE c2=2;
-DROP TABLE t;
-
--- sync_slave_with_master
--- connection master
-
--- echo ### checking master images
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10, 2=>0, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>100, 2=>0, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t VALUES (1,2,"a")
+-- let $row_img_expected_master= | 1:1 2:2 3:'a'
+-- let $row_img_expected_slave = | 1:1 2:2 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT INTO t(c1,c3) VALUES (10,"a")
+-- let $row_img_expected_master= | 1:10 2:0 3:'a'
+-- let $row_img_expected_slave = | 1:10 2:0 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT DELAYED INTO t(c1,c3) VALUES (100,"a")
+-- let $row_img_expected_master= | 1:100 2:0 3:'a'
+-- let $row_img_expected_slave = | 1:100 2:0 3:'a'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT INTO t(c1) VALUES (1000)
+-- let $row_img_expected_master= | 1:1000 2:0
+-- let $row_img_expected_slave = | 1:1000 2:0
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT DELAYED INTO t(c1) VALUES (10000)
+-- let $row_img_expected_master= | 1:10000 2:0
+-- let $row_img_expected_slave = | 1:10000 2:0
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c3='b' WHERE c1=1
+-- let $row_img_expected_master= 1:1 2:2 | 1:1 2:2 3:'b'
+-- let $row_img_expected_slave = 1:1 2:2 | 1:1 2:2 3:'b'
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= DELETE FROM t WHERE c2=2
+-- let $row_img_expected_master= 1:1 2:2 | 
+-- let $row_img_expected_slave = 1:1 2:2 | 
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1000, 2=>0}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10000, 2=>0}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2}
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'b\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1, 2=>2}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- remove_file $TMP_FILE
-
--- connection slave
--- echo ### checking slave images
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10, 2=>0, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>100, 2=>0, 3=>"\'a\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1000, 2=>0}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>10000, 2=>0}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2}
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'b\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1, 2=>2}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- remove_file $TMP_FILE
+DROP TABLE t;
+-- sync_slave_with_master
 
 -- echo ###################################
--- echo # (S4-1) AUTOINC columns
+-- echo # AUTOINC columns
 -- echo ###################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
+-- let $row_img_set=master:MINIMAL:N,slave:MINIMAL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1,c2));
-INSERT INTO t(c2) VALUES (2);
-DROP TABLE t;
--- sync_slave_with_master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
 
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
+-- let $row_img_query= INSERT INTO t(c2) VALUES (2)
+-- let $row_img_expected_master= | 1:1 2:2
+-- let $row_img_expected_slave = | 1:1 2:2
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- remove_file $TMP_FILE
+DROP TABLE t;
+-- sync_slave_with_master
 
 -- echo ##################################################################
--- echo # (S4-2) Test that slave does not write more columns than the ones it has 
+-- echo # Test that slave does not write more columns than the ones it has 
 -- echo ##################################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
+-- let $row_img_set=master:MINIMAL:N,slave:MINIMAL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL AUTO_INCREMENT, c2 int, c3 blob, primary key(c1,c2));
@@ -461,63 +402,27 @@ CREATE TABLE t (c1 int, c2 int, primary 
 
 -- connection master
 
-INSERT INTO t(c2,c3) VALUES (2,'aaaaa');
-UPDATE t SET c2=3, c3='bbbbb' WHERE c2=2;
+-- let $row_img_query= INSERT INTO t(c2,c3) VALUES (2,'aaaaa')
+-- let $row_img_expected_master= | 1:1 2:2 3:'aaaaa'
+-- let $row_img_expected_slave = | 1:1 2:2
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c2=3, c3='bbbbb' WHERE c2=2
+-- let $row_img_expected_master= 1:1 2:2 | 2:3 3:'bbbbb'
+-- let $row_img_expected_slave = 1:1 | 2:3
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
 DROP TABLE t;
 -- sync_slave_with_master
 
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={2=>3}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>"\'aaaaa\'"}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2}
--- let IMG_AI_EXPECTED={2=>3, 3=>"\'bbbbb\'"}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- remove_file $TMP_FILE
-
 -- echo ##################################################################
--- echo # (S4-5) Test that slave fills default columns in its own columns
+-- echo # Test that slave fills default columns in its own columns
 -- echo ##################################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
+-- let $row_img_set=master:FULL:N,slave:FULL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int, c2 int);
@@ -527,69 +432,34 @@ SET SQL_LOG_BIN=1;
 CREATE TABLE t (c1 int, c2 int, c3 int DEFAULT 2005);
 
 -- connection master
-INSERT INTO t(c1) VALUES (1);
-INSERT INTO t(c1) VALUES (2);
--- sync_slave_with_master
-SELECT * FROM t;
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>NULL, 3=>2005}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>2, 2=>NULL, 3=>2005}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t(c1) VALUES (1)
+-- let $row_img_expected_master= | 1:1 2:NULL
+-- let $row_img_expected_slave = | 1:1 2:NULL 3:2005
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= INSERT INTO t(c1) VALUES (2)
+-- let $row_img_expected_master= | 1:2 2:NULL
+-- let $row_img_expected_slave = | 1:2 2:NULL 3:2005
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
+-- connection slave
+SELECT * FROM t;
 -- connection master
 SELECT * FROM t;
 
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>NULL}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>2, 2=>NULL}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
 DROP TABLE t;
 -- sync_slave_with_master
 
-
--- remove_file $TMP_FILE
-
 -- echo ##################################################################
--- echo # (S4-6) Test that slave uses partial BI when master contains more columns
+-- echo # Test that slave uses partial BI when master contains more columns
 -- echo ##################################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
+-- let $row_img_set=master:MINIMAL:N,slave:MINIMAL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1, c3), unique key(c1));
@@ -599,68 +469,34 @@ SET SQL_LOG_BIN=1;
 CREATE TABLE t (c1 int NOT NULL, c2 int, unique key(c1));
 
 -- connection master
-INSERT INTO t VALUES (1, 2, 3);
-UPDATE t SET c2= 4 WHERE c1=1;
--- sync_slave_with_master
-SELECT * FROM t;
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={2=>4}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t VALUES (1, 2, 3)
+-- let $row_img_expected_master= | 1:1 2:2 3:3
+-- let $row_img_expected_slave = | 1:1 2:2
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c2= 4 WHERE c1=1
+-- let $row_img_expected_master= 1:1 3:3 | 2:4
+-- let $row_img_expected_slave = 1:1 | 2:4
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
+-- connection slave
+SELECT * FROM t;
 -- connection master
 SELECT * FROM t;
 
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>3}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 3=>3}
--- let IMG_AI_EXPECTED={2=>4}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
 DROP TABLE t;
 -- sync_slave_with_master
--- remove_file $TMP_FILE
 
 -- echo ##################################################################
--- echo # (S4-3) Test that if master has binlog_row_image=MINIMAL and slave has 
+-- echo # Test that if master has binlog_row_image=MINIMAL and slave has 
 -- echo # NOBLOB or FULL, it will log the expected columns
 -- echo ##################################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='FULL';
-SET SESSION binlog_row_image='FULL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
+-- let $row_img_set=master:MINIMAL:N,slave:FULL:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1));
@@ -670,72 +506,28 @@ SET SQL_LOG_BIN=1;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, c4 blob, unique key(c1));
 
 -- connection master
-INSERT INTO t VALUES (1, 2, 3);
-UPDATE t SET c2= 4 WHERE c1=1;
-DELETE FROM t WHERE c2=4;
--- sync_slave_with_master
+-- let $row_img_query= INSERT INTO t VALUES (1, 2, 3)
+-- let $row_img_expected_master= | 1:1 2:2 3:3
+-- let $row_img_expected_slave = | 1:1 2:2 3:3 4:NULL
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
+-- let $row_img_query= UPDATE t SET c2= 4 WHERE c1=1
+-- let $row_img_expected_master=  1:1 | 2:4
+-- let $row_img_expected_slave = 1:1 2:2 3:3 4:NULL | 1:1 2:4 3:3 4:NULL
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>3, 4=>NULL}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2, 3=>3, 4=>NULL}
--- let IMG_AI_EXPECTED={1=>1, 2=>4, 3=>3, 4=>NULL}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1, 2=>4, 3=>3, 4=>NULL}
--- let IMG_AI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= DELETE FROM t WHERE c2=4
+-- let $row_img_expected_master= 1:1 |
+-- let $row_img_expected_slave = 1:1 2:4 3:3 4:NULL | 
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- connection master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>3}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={2=>4}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
 DROP TABLE t;
 -- sync_slave_with_master
--- remove_file $TMP_FILE
-
--- source include/master-slave-reset.inc
--- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
-SHOW VARIABLES LIKE 'binlog_row_image';
 
--- source include/stop_slave.inc
--- source include/start_slave.inc
 -- source include/master-slave-reset.inc
 -- connection master
+-- let $row_img_set=master:MINIMAL:N,slave:NOBLOB:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c1));
@@ -745,77 +537,32 @@ SET SQL_LOG_BIN=1;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, c4 blob, unique key(c1));
 
 -- connection master
-INSERT INTO t VALUES (1, 2, 3);
-UPDATE t SET c2= 4 WHERE c1=1;
-DELETE FROM t WHERE c2=4;
--- sync_slave_with_master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/slave-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>3}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1, 2=>2, 3=>3}
--- let IMG_AI_EXPECTED={1=>1, 2=>4, 3=>3}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1, 2=>4, 3=>3}
--- let IMG_AI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- connection master
-
--- let $MYSQLD_DATADIR= `select @@datadir;`
--- exec $MYSQL_BINLOG -v $MYSQLD_DATADIR/master-bin.000001 > $TMP_FILE
-
--- let IMG_STMT_TYPE=INSERT
--- let IMG_AI_EXPECTED={1=>1, 2=>2, 3=>3}
--- let IMG_BI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=UPDATE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={2=>4}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
-
--- let IMG_STMT_TYPE=DELETE
--- let IMG_BI_EXPECTED={1=>1}
--- let IMG_AI_EXPECTED={}
--- source suite/rpl/include/rpl_row_mysqbinlog_img_check.inc
+-- let $row_img_query= INSERT INTO t VALUES (1, 2, 3)
+-- let $row_img_expected_master= | 1:1 2:2 3:3
+-- let $row_img_expected_slave = | 1:1 2:2 3:3
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= UPDATE t SET c2= 4 WHERE c1=1
+-- let $row_img_expected_master= 1:1 | 2:4
+-- let $row_img_expected_slave = 1:1 2:2 3:3 | 1:1 2:4 3:3
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
+
+-- let $row_img_query= DELETE FROM t WHERE c2=4
+-- let $row_img_expected_master= 1:1 |
+-- let $row_img_expected_slave = 1:1 2:4 3:3 | 
+-- source suite/rpl/include/rpl_row_img_parts_master_slave.inc
 
--- connection master
 DROP TABLE t;
 -- sync_slave_with_master
--- remove_file $TMP_FILE
-
 
 -- echo ################################################################
--- echo # (S4-4) Test that the slave stop with error if no usable data is on BI
+-- echo # Test that the slave stop with error if no usable data is on BI
 -- echo ################################################################
 
 -- source include/master-slave-reset.inc
 -- connection master
-# global so that flush tables restarts the 
-# insert dealyed thread
-SET GLOBAL binlog_row_image='MINIMAL';
-SET SESSION binlog_row_image='MINIMAL';
-SHOW VARIABLES LIKE 'binlog_row_image';
-FLUSH TABLES;
--- connection slave
-# global so that SQL thread also gets the change
-SET GLOBAL binlog_row_image='NOBLOB';
-SET SESSION binlog_row_image='NOBLOB';
-SHOW VARIABLES LIKE 'binlog_row_image';
-
--- source include/stop_slave.inc
--- source include/start_slave.inc
--- source include/master-slave-reset.inc
--- connection master
+-- let $row_img_set=master:MINIMAL:N,slave:NOBLOB:Y
+-- source suite/rpl/include/rpl_row_img_set.inc
 
 SET SQL_LOG_BIN=0;
 CREATE TABLE t (c1 int NOT NULL, c2 int, c3 int, primary key(c3));
@@ -832,8 +579,13 @@ DROP TABLE t;
 
 -- connection slave
 -- source include/wait_for_slave_sql_to_stop.inc
--- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1)
--- echo $err
+-- let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1)
+if (`SELECT $err <> 1032`) 
+{
+  ## if error != HA_ERR_END_OF_FILE
+  SHOW SLAVE STATUS;
+  -- die UNEXPECTED ERROR: $err
+}
 -- source include/stop_slave.inc
 
 DROP TABLE t;

=== removed file 'mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test'
--- a/mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test	2009-10-21 13:01:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_record_find_innodb.test	1970-01-01 00:00:00 +0000
@@ -1,46 +0,0 @@
-#
-# BUG#40045: Replication failure on RBR + no PK + UPDATE + integer key +
-#            char with no key
-#
-# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields 
-#
-# Test Description
-# ================
-#  
-#   (see rpl_row_record_find_myisam.test)
-#
-
-source include/master-slave.inc;
-source include/have_binlog_format_row.inc;
-connection master;
-source include/have_innodb.inc;
-connection slave;
-source include/have_innodb.inc;
-connection master;
-
---echo #################################################################
---echo # CASE 5: InnoDB - master, MyISAM - slave
---echo #################################################################
-
-let $master_engine= InnoDB;
-let $slave_engine= MyISAM;
-
--- source extra/rpl_tests/rpl_row_record_find.test
-
---echo #################################################################
---echo # CASE 6: InnoDB - master, InnoDB - slave
---echo #################################################################
-
-let $master_engine= InnoDB;
-let $slave_engine= InnoDB;
-
--- source extra/rpl_tests/rpl_row_record_find.test
-
---echo #################################################################
---echo # CASE 7: MyISAM - master, InnoDB - slave
---echo #################################################################
-
-let $master_engine= MyISAM;
-let $slave_engine= InnoDB;
-
--- source extra/rpl_tests/rpl_row_record_find.test

=== modified file 'mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test'
--- a/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test	2009-10-21 13:01:59 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_record_find_myisam.test	2010-03-26 11:09:50 +0000
@@ -1,53 +1,20 @@
+source include/master-slave.inc;
+source include/have_binlog_format_row.inc;
+
 #
 # BUG#40045: Replication failure on RBR + no PK + UPDATE + integer key + char
 # with no key
 #
-# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields 
-#
-# TEST DESCRIPTION
-# ================
-#
-#   This test is structure in seven cases. In all of them, roughly the same
-#   update and delete operations are performed, but what changes are the keys
-#   in the table: 
-#      no keys, one key, composite key (but only half is used in query),
-#      unique key, primary key
-#   
-#   The four cases are distinct because the engine on both and master and
-#   slave varies:
-#      
-#      - On rpl_row_record_find_myisam.test (this) test file:
-#        CASE 1:  MyISAM - master, MyISAM - slave
-#           test without HA_PARTIAL_COLUMN_READ engine on master and on slave
-#
-#      - On rpl_row_record_find_innodb.test:
-#        CASE 2:  InnoDB - master, MyISAM - slave
-#           test with HA_PARTIAL_COLUMN_READ engine on master but not on slave
-#           (InnoDB)
-#        CASE 3:  InnoDB - master, InnoDB - slave
-#           test with HA_PARTIAL_COLUMN_READ engine on master and on slave
-#           (InnoDB)
-#        CASE 4:  MyISAM - master, InnoDB - slave
-#           test without HA_PARTIAL_COLUMN_READ engine on master but with it on slave
-#           (InnoDB)
-#
-#   NOTE: In this file we also perform a sanity check by running the test
-#         cases to verify some of the BUGS.
-
-source include/master-slave.inc;
-source include/have_binlog_format_row.inc;
 connection master;
-
-### SANITY TESTS for BUG#40045 and BUG#40007
-
-# TEST CASE USED for verifying BUG#40045
 CREATE TABLE t1 ( i1 int, c1 char(1), key ( i1 ));
 INSERT IGNORE INTO t1 VALUES (1, 'a');
 UPDATE t1 SET c1 = 'b' WHERE i1 = 1;
 DROP TABLE t1;
 sync_slave_with_master;
 
-# TEST CASE USED for verifying BUG#40007
+#
+# BUG#40007: Replication failure with RBR + no PK + 2 indexed fields 
+#
 connection master;
 CREATE TABLE table1_myisam ( `bit_key` bit, `int_key` int, key (`bit_key` ), key (`int_key` ));
 disable_warnings;
@@ -56,14 +23,3 @@ enable_warnings;
 UPDATE `table1_myisam` SET `bit_key` = 0 WHERE `bit_key` = 1;
 DROP TABLE table1_myisam;
 sync_slave_with_master;
-
-connection master;
-
---echo #################################################################
---echo # CASE 1: MyISAM - master, MyISAM - slave
---echo #################################################################
-
-let $master_engine= MyISAM;
-let $slave_engine= MyISAM;
-
--- source extra/rpl_tests/rpl_row_record_find.test


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20100326110950-pcvq31jg66mxgaqy.bundle
Thread
bzr commit into mysql-5.1-rpl-wl5092 branch (luis.soares:3182) WL#5096Luis Soares26 Mar