List:Commits« Previous MessageNext Message »
From:Luis Soares Date:May 10 2010 11:33pm
Subject:bzr commit into mysql-5.1-rpl-wl5092 branch (luis.soares:3188)
Bug#49100
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/bugfixing/49100/mysql-5.1-rpl-wl5092/ based on revid:luis.soares@stripped

 3188 Luis Soares	2010-05-11
      BUG#49100: RBR: Unexpected behavior when AI contains no usable data for 
                 slave columns
      
      Addressing review comments:
      
        1. Added NDB test case, even if it does not work (because of
           BUG#52473.
        2. Fixed typo '=' -> '=='
        3. Added missing parenthesis.
     @ mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test
        Engine agnostic part of the test case.
     @ mysql-test/suite/rpl/t/rpl_row_img.test
        Moved agnostic part of the test case into extra/rpl_tests.
        Added tests for InnoDB as well.
     @ mysql-test/suite/rpl_ndb/t/disabled.def
        Added rpl_ndb_row_img (just added) test case. We add it so that
        it can be disabled after BUG#52473 is fixed.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.cnf
        Configuration file for chained NDB replication: master -> slave1 -> slave2.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.test
        Test case for NDB which just sets up NDB and sources the 
        engine agnostic part of the test.
     @ sql/log_event.cc
        Review comments: missing parenthesis and "dangerous" typo!

    added:
      mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_row_img.result
      mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.cnf
      mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.test
    modified:
      mysql-test/suite/rpl/r/rpl_row_img.result
      mysql-test/suite/rpl/t/rpl_row_img.test
      mysql-test/suite/rpl_ndb/t/disabled.def
      sql/log_event.cc
=== added file 'mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_empty_imgs.test	2010-05-10 23:33:42 +0000
@@ -0,0 +1,339 @@
+#
+# BUG#49100: RBR: Unexpected behavior when AI contains no usable data 
+#            for slave columns
+
+-- connection mysqld_c
+-- source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_b
+-- source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_a
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_c
+-- source include/start_slave.inc
+
+-- connection mysqld_b
+-- source include/start_slave.inc
+
+-- disable_warnings
+DROP TABLE IF EXISTS t1;
+-- enable_warnings
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_a
+
+-- let $row_img_set=mysqld_a:MINIMAL:N,mysqld_b:MINIMAL:Y,mysqld_c:MINIMAL:Y
+-- source include/rpl_row_img_set.inc
+
+-- echo #### case #1: AI: no values logged
+
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+INSERT INTO t1 VALUES ();
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+DROP TABLE t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+
+-- echo #### case #2: AI: not empty but slave does not have usable data for its columns (INSERT)
+
+-- connection mysqld_c
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+
+-- connection mysqld_b
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+-- connection mysqld_a
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2)) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+INSERT INTO t1(c2) VALUES (1);
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+DROP TABLE t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+
+-- echo #### case #3: BI: usable columns on the slave, AI: no usable columns on the slave
+
+-- connection mysqld_c
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+
+-- connection mysqld_b
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+-- connection mysqld_a
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100, c2 int) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+UPDATE t1 SET c2=2 WHERE c1=1 AND c2=1;
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+DROP TABLE t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+
+-- echo #### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE).
+-- echo ####          
+
+if ($verbose)
+{
+  ## CLEAN LOGS (to show clean events later)
+
+  -- connection mysqld_c
+  -- source include/stop_slave.inc
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_b
+  -- source include/stop_slave.inc
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_a
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_c
+  -- source include/start_slave.inc
+
+  -- connection mysqld_b
+  -- source include/start_slave.inc
+
+  ## CLEANED
+}
+
+-- connection mysqld_c
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+
+-- connection mysqld_b
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+-- connection mysqld_a
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2)) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+INSERT INTO t1 VALUES (1,1,1);
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+UPDATE t1 SET c3=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+DROP TABLE t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+
+if ($verbose)
+{
+  # show that 2nd slave does not log the update (see: BUG#52473)
+  -- connection mysqld_a
+  -- echo # Master events
+  -- source include/show_binlog_events.inc
+  -- connection mysqld_b
+  -- echo # First slave events
+  -- source include/show_binlog_events.inc
+  -- connection mysqld_a
+}
+
+-- echo #### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop).
+-- echo #### 
+
+
+if ($verbose)
+{
+  ## CLEAN LOGS
+
+  -- connection mysqld_c
+  -- source include/stop_slave.inc
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_b
+  -- source include/stop_slave.inc
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_a
+  RESET MASTER;
+  RESET SLAVE;
+
+  -- connection mysqld_c
+  -- source include/start_slave.inc
+
+  -- connection mysqld_b
+  -- source include/start_slave.inc
+
+  ## CLEANED
+}
+
+-- connection mysqld_c
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=$engine
+
+-- connection mysqld_b
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+-- connection mysqld_a
+SET SQL_LOG_BIN=0;
+-- replace_result $engine ENGINE
+-- eval CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY) Engine=$engine
+SET SQL_LOG_BIN=1;
+
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- source include/rpl_chained_3_hosts_sync.inc
+-- connection mysqld_b
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_c
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+
+-- connection mysqld_a
+UPDATE t1 SET c1=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+SELECT * FROM t1;
+-- connection mysqld_b
+
+-- let $lower_engine= `SELECT LOWER('$engine')`
+if (`SELECT '$lower_engine' = 'ndb'`)
+{
+  if ($verbose)
+  {
+    -- echo # scenario #5 skipped in NDB  (see: BUG#52473).
+    # show events logged in mysqld_a. There will be two Write_rows events
+    # instead of one Write_rows and one Update_rows log events.
+    -- connection mysqld_a
+    -- source include/show_binlog_events.inc
+  }
+}
+
+SET SQL_LOG_BIN=0;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+SET SQL_LOG_BIN=1;
+
+# NOTE: Because of BUG#52473, when using NDB this will make the test
+#       wait forever.
+-- source include/wait_for_slave_sql_to_stop.inc
+-- let $errno=query_get_value("show slave status", Last_SQL_Errno, 1)
+if (`SELECT $errno <> 1032`)
+{
+  -- echo ### UNEXPECTED ERROR AT THE SLAVE: $errno
+  SHOW SLAVE STATUS;
+  -- die
+}
+-- echo ### SLAVE STOPPED AS EXPECTED!
+
+## CLEAN UP
+
+-- connection mysqld_c
+-- source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_b
+-- source include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_a
+RESET MASTER;
+RESET SLAVE;
+
+-- connection mysqld_c
+-- source include/start_slave.inc
+
+-- connection mysqld_b
+-- source include/start_slave.inc
+
+-- connection mysqld_a
+-- disable_warnings
+DROP TABLE IF EXISTS t1;
+-- enable_warnings
+-- source include/rpl_chained_3_hosts_sync.inc
+
+-- let $row_img_set=mysqld_a:FULL:N,mysqld_b:FULL:Y,mysqld_c:FULL:Y
+-- source include/rpl_row_img_set.inc
+

=== modified file 'mysql-test/suite/rpl/r/rpl_row_img.result'
--- a/mysql-test/suite/rpl/r/rpl_row_img.result	2010-04-21 00:54:25 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_img.result	2010-05-10 23:33:42 +0000
@@ -24179,6 +24179,7 @@ FLUSH TABLES;
 SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	FULL
+### Testing with MyISAM storage engine
 include/stop_slave.inc
 RESET MASTER;
 RESET SLAVE;
@@ -24216,7 +24217,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
 Variable_name	Value
 binlog_row_image	MINIMAL
 #### case #1: AI: no values logged
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 INSERT INTO t1 VALUES ();
 SHOW VARIABLES LIKE 'server_id';
 Variable_name	Value
@@ -24238,12 +24239,12 @@ c1
 100
 DROP TABLE t1;
 #### case #2: AI: not empty but slave does not have usable data for its columns (INSERT)
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2));
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2)) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 INSERT INTO t1(c2) VALUES (1);
 SHOW VARIABLES LIKE 'server_id';
@@ -24266,12 +24267,12 @@ c1
 100
 DROP TABLE t1;
 #### case #3: BI: usable columns on the slave, AI: no usable columns on the slave
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int);
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 INSERT INTO t1 VALUES (1,1);
 SHOW VARIABLES LIKE 'server_id';
@@ -24314,12 +24315,12 @@ c1
 DROP TABLE t1;
 #### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE).
 ####          
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2));
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2)) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 INSERT INTO t1 VALUES (1,1,1);
 SHOW VARIABLES LIKE 'server_id';
@@ -24361,13 +24362,290 @@ c1
 1
 DROP TABLE t1;
 #### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop).
+#### 
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c1=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+300	1
+SET SQL_LOG_BIN=0;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+SET SQL_LOG_BIN=1;
+### SLAVE STOPPED AS EXPECTED!
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+DROP TABLE IF EXISTS t1;
+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
+include/start_slave.inc
+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
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name	Value
+binlog_row_image	FULL
+### Testing with InnoDB storage engine
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+DROP TABLE IF EXISTS t1;
+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
+include/start_slave.inc
+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
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name	Value
+binlog_row_image	MINIMAL
+#### case #1: AI: no values logged
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+INSERT INTO t1 VALUES ();
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+100
+DROP TABLE t1;
+#### case #2: AI: not empty but slave does not have usable data for its columns (INSERT)
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2)) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1(c2) VALUES (1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+100	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+100
+DROP TABLE t1;
+#### case #3: BI: usable columns on the slave, AI: no usable columns on the slave
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c2=2 WHERE c1=1 AND c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	2
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+#### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE).
 ####          
-CREATE TABLE t1 (c1 INT DEFAULT 100);
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2)) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2	c3
+1	1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c3=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2	c3
+1	1	300
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+#### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop).
+#### 
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 INT DEFAULT 100);
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY);
+CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY) Engine=ENGINE;
 SET SQL_LOG_BIN=1;
 INSERT INTO t1 VALUES (1,1);
 SHOW VARIABLES LIKE 'server_id';
@@ -24398,7 +24676,7 @@ c1	c2
 SET SQL_LOG_BIN=0;
 call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
 SET SQL_LOG_BIN=1;
-### SLAVE STOPPED HAS EXPECTED!
+### SLAVE STOPPED AS EXPECTED!
 include/stop_slave.inc
 RESET MASTER;
 RESET SLAVE;

=== modified file 'mysql-test/suite/rpl/t/rpl_row_img.test'
--- a/mysql-test/suite/rpl/t/rpl_row_img.test	2010-04-21 00:54:25 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_img.test	2010-05-10 23:33:42 +0000
@@ -50,245 +50,15 @@
 -- source include/rpl_row_img_general_loop.inc
 
 #
-# BUG#49100: RBR: Unexpected behavior when AI contains no usable data 
-#            for slave columns
+# BUG#49100
 #
 
--- connection mysqld_c
--- source include/stop_slave.inc
-RESET MASTER;
-RESET SLAVE;
+-- echo ### Testing with MyISAM storage engine
 
--- connection mysqld_b
--- source include/stop_slave.inc
-RESET MASTER;
-RESET SLAVE;
+-- let $engine=MyISAM
+-- source extra/rpl_tests/rpl_row_empty_imgs.test
 
--- connection mysqld_a
-RESET MASTER;
-RESET SLAVE;
-
--- connection mysqld_c
--- source include/start_slave.inc
-
--- connection mysqld_b
--- source include/start_slave.inc
-
--- disable_warnings
-DROP TABLE IF EXISTS t1;
--- enable_warnings
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_a
-
--- let $row_img_set=mysqld_a:MINIMAL:N,mysqld_b:MINIMAL:Y,mysqld_c:MINIMAL:Y
--- source include/rpl_row_img_set.inc
-
--- echo #### case #1: AI: no values logged
-
-CREATE TABLE t1 (c1 int DEFAULT 100);
-INSERT INTO t1 VALUES ();
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-DROP TABLE t1;
--- source include/rpl_chained_3_hosts_sync.inc
-
--- echo #### case #2: AI: not empty but slave does not have usable data for its columns (INSERT)
-
--- connection mysqld_c
-CREATE TABLE t1 (c1 int DEFAULT 100);
-
--- connection mysqld_b
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
-SET SQL_LOG_BIN=1;
-
--- connection mysqld_a
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2));
-SET SQL_LOG_BIN=1;
-
-INSERT INTO t1(c2) VALUES (1);
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-DROP TABLE t1;
--- source include/rpl_chained_3_hosts_sync.inc
-
--- echo #### case #3: BI: usable columns on the slave, AI: no usable columns on the slave
-
--- connection mysqld_c
-CREATE TABLE t1 (c1 int DEFAULT 100);
-
--- connection mysqld_b
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
-SET SQL_LOG_BIN=1;
-
--- connection mysqld_a
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int);
-SET SQL_LOG_BIN=1;
-
-INSERT INTO t1 VALUES (1,1);
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-UPDATE t1 SET c2=2 WHERE c1=1 AND c2=1;
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-DROP TABLE t1;
--- source include/rpl_chained_3_hosts_sync.inc
-
--- echo #### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE).
--- echo ####          
-
--- connection mysqld_c
-CREATE TABLE t1 (c1 int DEFAULT 100);
-
--- connection mysqld_b
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100);
-SET SQL_LOG_BIN=1;
-
--- connection mysqld_a
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2));
-SET SQL_LOG_BIN=1;
-
-INSERT INTO t1 VALUES (1,1,1);
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-UPDATE t1 SET c3=300 WHERE c2=1;
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-DROP TABLE t1;
--- source include/rpl_chained_3_hosts_sync.inc
-
--- echo #### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop).
--- echo ####          
-
--- connection mysqld_c
-CREATE TABLE t1 (c1 INT DEFAULT 100);
-
--- connection mysqld_b
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 INT DEFAULT 100);
-SET SQL_LOG_BIN=1;
-
--- connection mysqld_a
-SET SQL_LOG_BIN=0;
-CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY);
-SET SQL_LOG_BIN=1;
-
-INSERT INTO t1 VALUES (1,1);
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- source include/rpl_chained_3_hosts_sync.inc
--- connection mysqld_b
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_c
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
-
--- connection mysqld_a
-UPDATE t1 SET c1=300 WHERE c2=1;
-SHOW VARIABLES LIKE 'server_id';
-SELECT * FROM t1;
--- connection mysqld_b
-SET SQL_LOG_BIN=0;
-call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
-SET SQL_LOG_BIN=1;
--- source include/wait_for_slave_sql_to_stop.inc
--- let $errno=query_get_value("show slave status", Last_SQL_Errno, 1)
-if (`SELECT $errno <> 1032`)
-{
-  -- echo ### UNEXPECTED ERROR AT THE SLAVE: $errno
-  SHOW SLAVE STATUS;
-  -- die
-}
--- echo ### SLAVE STOPPED HAS EXPECTED!
-
-## CLEAN UP
-
--- connection mysqld_c
--- source include/stop_slave.inc
-RESET MASTER;
-RESET SLAVE;
-
--- connection mysqld_b
--- source include/stop_slave.inc
-RESET MASTER;
-RESET SLAVE;
-
--- connection mysqld_a
-RESET MASTER;
-RESET SLAVE;
-
--- connection mysqld_c
--- source include/start_slave.inc
-
--- connection mysqld_b
--- source include/start_slave.inc
-
--- connection mysqld_a
--- disable_warnings
-DROP TABLE IF EXISTS t1;
--- enable_warnings
--- source include/rpl_chained_3_hosts_sync.inc
-
--- let $row_img_set=mysqld_a:FULL:N,mysqld_b:FULL:Y,mysqld_c:FULL:Y
--- source include/rpl_row_img_set.inc
+-- echo ### Testing with InnoDB storage engine
 
+-- let $engine=InnoDB
+-- source extra/rpl_tests/rpl_row_empty_imgs.test

=== added file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_row_img.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_img.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_img.result	2010-05-10 23:33:42 +0000
@@ -0,0 +1,291 @@
+include/stop_slave.inc
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+RESET MASTER;
+RESET SLAVE;
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_A_PORT,master_user='root',MASTER_LOG_FILE='MASTER_A_LOG_FILE';
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',MASTER_LOG_FILE='MASTER_B_LOG_FILE';
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+include/start_slave.inc
+include/start_slave.inc
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+DROP TABLE IF EXISTS t1;
+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
+include/start_slave.inc
+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
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name	Value
+binlog_row_image	MINIMAL
+#### case #1: AI: no values logged
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+INSERT INTO t1 VALUES ();
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+100
+DROP TABLE t1;
+#### case #2: AI: not empty but slave does not have usable data for its columns (INSERT)
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, primary key(c2)) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1(c2) VALUES (1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+100	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+100
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+100
+DROP TABLE t1;
+#### case #3: BI: usable columns on the slave, AI: no usable columns on the slave
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c2=2 WHERE c1=1 AND c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	2
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+#### case #4: AI, BI: no usable columns on the slave (NOOP UPDATE).
+####          
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 int DEFAULT 100, c2 int, c3 int, primary key(c2)) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2	c3
+1	1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c3=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2	c3
+1	1	300
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+DROP TABLE t1;
+#### case #5: BI: no usable columns on the slave, AI: usable columns on the slave (slave must stop).
+#### 
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 INT DEFAULT 100) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+SET SQL_LOG_BIN=0;
+CREATE TABLE t1 (c1 INT DEFAULT 100, c2 INT PRIMARY KEY) Engine=ENGINE;
+SET SQL_LOG_BIN=1;
+INSERT INTO t1 VALUES (1,1);
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+1	1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	2
+SELECT * FROM t1;
+c1
+1
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	3
+SELECT * FROM t1;
+c1
+1
+UPDATE t1 SET c1=300 WHERE c2=1;
+SHOW VARIABLES LIKE 'server_id';
+Variable_name	Value
+server_id	1
+SELECT * FROM t1;
+c1	c2
+300	1
+SET SQL_LOG_BIN=0;
+call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032");
+SET SQL_LOG_BIN=1;
+### SLAVE STOPPED AS EXPECTED!
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+include/stop_slave.inc
+RESET MASTER;
+RESET SLAVE;
+RESET MASTER;
+RESET SLAVE;
+include/start_slave.inc
+include/start_slave.inc
+DROP TABLE IF EXISTS t1;
+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
+include/start_slave.inc
+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
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name	Value
+binlog_row_image	FULL

=== modified file 'mysql-test/suite/rpl_ndb/t/disabled.def'
--- a/mysql-test/suite/rpl_ndb/t/disabled.def	2010-03-30 16:18:36 +0000
+++ b/mysql-test/suite/rpl_ndb/t/disabled.def	2010-05-10 23:33:42 +0000
@@ -13,3 +13,4 @@
 # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
 rpl_ndb_2ndb   : Bug#45974: rpl_ndb_2ndb fails sporadically
 rpl_ndb_idempotent : BUG#52473 30-03-2010 luis NDB inserts row when updating slave's empty table
+rpl_ndb_row_img    : BUG#52473 11-05-2010 luis NDB slave inserts row instead of updating existing one

=== added file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.cnf'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.cnf	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.cnf	2010-05-10 23:33:42 +0000
@@ -0,0 +1,29 @@
+!include ../my.cnf
+
+[cluster_config.slave2]
+NoOfReplicas=                  1   
+ndbd=
+ndb_mgmd=
+mysqld=
+
+
+[mysqld.1.1]
+server-id= 1
+log-bin
+
+[mysqld.1.slave]
+server-id= 2
+log-bin
+skip-slave-start
+
+[mysqld.1.slave2]
+server-id= 3
+log-bin
+skip-slave-start
+
+ndb_connectstring=	@mysql_cluster.slave.ndb_connectstring
+
+[ENV]
+
+SLAVE_MYPORT1=		@mysqld.1.slave2.port
+SLAVE_MYSOCK1=		@mysqld.1.slave2.socket

=== added file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_img.test	2010-05-10 23:33:42 +0000
@@ -0,0 +1,9 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_row.inc
+-- source include/rpl_chained_3_hosts.inc
+
+-- connection mysqld_a
+
+-- let $engine=NDB
+-- source extra/rpl_tests/rpl_row_empty_imgs.test
+

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2010-04-21 00:54:25 +0000
+++ b/sql/log_event.cc	2010-05-10 23:33:42 +0000
@@ -1954,7 +1954,7 @@ void Rows_log_event::print_verbose(IO_CA
   }
 
   /* If the write rows event contained no values for the AI */
-  if ((type_code == WRITE_ROWS_EVENT) && (m_rows_buf==m_rows_end))
+  if (((type_code == WRITE_ROWS_EVENT) && (m_rows_buf==m_rows_end)))
   {
     my_b_printf(file, "### INSERT INTO `%s`.`%s` VALUES ()\n", 
                       map->get_db_name(), map->get_table_name());
@@ -8710,7 +8710,7 @@ Rows_log_event::write_row(const Relay_lo
     ulong estimated_rows;
     if (m_curr_row < m_curr_row_end)
       estimated_rows= (m_rows_end - m_curr_row) / (m_curr_row_end - m_curr_row);
-    else if (m_curr_row = m_curr_row_end)
+    else if (m_curr_row == m_curr_row_end)
       estimated_rows= 1;
 
     m_table->file->ha_start_bulk_insert(estimated_rows);


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20100510233342-aaarke5k95qahuip.bundle
Thread
bzr commit into mysql-5.1-rpl-wl5092 branch (luis.soares:3188)Bug#49100Luis Soares11 May