MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Luis Soares Date:October 9 2009 10:03am
Subject:bzr commit into mysql-6.0-codebase-bugfixing branch (luis.soares:3654)
Bug#47103
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/bugfixing/47103/mysql-6.0-codebase-bugfixing-to-push/ based on revid:alik@ibmvm-20091009095905-mg25j9xichuj7hek

 3654 Luis Soares	2009-10-09 [merge]
      BUG#47103: automerge 6.0-cb-bf local bug branch --> 6.0-cb-bf up to date.

    added:
      mysql-test/suite/rpl/r/rpl_row_merge_engine.result
      mysql-test/suite/rpl/t/rpl_row_merge_engine.test
    modified:
      sql/log_event.cc
=== added file 'mysql-test/suite/rpl/r/rpl_row_merge_engine.result'
--- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result	2009-10-01 14:54:45 +0000
@@ -0,0 +1,56 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+DROP TABLE IF EXISTS t1,t2,t3;
+CREATE TABLE t1 ( f1 integer , f2 int, primary key (f1)) ENGINE = MyISAM;
+CREATE TABLE t2 ( f1 integer , f2 int, primary key (f1)) ENGINE = MyISAM;
+CREATE TABLE t3 ( f1 integer , f2 int, primary key (f1)) ENGINE = MERGE UNION (t1,t2);
+INSERT IGNORE INTO t2 VALUES  (1, 1);
+UPDATE t3  SET `f2` = 7 LIMIT 1;
+SELECT * FROM t3;
+f1	f2
+1	7
+DROP TABLE t1, t2, t3;
+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 `table0_int_autoinc` ( `int` int, pk integer
+auto_increment, `int_key` int,
+primary key (pk), key (`int_key`));
+CREATE TABLE `table10_int_autoinc` ( `int` int, pk integer
+auto_increment, `int_key` int,
+primary key (pk), key (`int_key`));
+INSERT IGNORE INTO table10_int_autoinc VALUES (NULL, NULL,
+'-474021888') , ('1', NULL, NULL) , ('1141047296', NULL, NULL) ,
+(NULL, NULL, NULL) , (NULL, NULL, '1') , (NULL, NULL, '9') , ('0',
+NULL, '1225785344') , (NULL, NULL, '1574174720') , ('2', NULL, NULL) ,
+('6', NULL, '3');
+CREATE TABLE IF NOT EXISTS t1_merge_1_A LIKE test.table0_int_autoinc;
+ALTER TABLE t1_merge_1_A ENGINE = MERGE UNION ( table10_int_autoinc , table0_int_autoinc);
+DELETE FROM t1_merge_1_A;
+DROP TABLE table0_int_autoinc, table10_int_autoinc, t1_merge_1_A;
+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 t1 (a int);
+CREATE TABLE t2 (a int);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (4), (5), (6);
+CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
+ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
+UPDATE t1_merge SET a=10 WHERE a=1;
+DELETE FROM t1_merge WHERE a=10;
+Comparing tables master:test.t1 and slave:test.t1
+Comparing tables master:test.t2 and slave:test.t2
+DROP TABLE t1_merge, t1, t2;

=== added file 'mysql-test/suite/rpl/t/rpl_row_merge_engine.test'
--- a/mysql-test/suite/rpl/t/rpl_row_merge_engine.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_merge_engine.test	2009-10-01 14:54:45 +0000
@@ -0,0 +1,115 @@
+#
+# BUG#47103
+# 
+# This test case checks whether the slave crashes or not when there is
+# a merge table in use.
+#
+# Description
+# ===========
+#
+# The test case creates two regular MyISAM tables on the master and
+# one MERGE table. Then it populates the MyISAM tables and deletes
+# their contents through the merge table. Finally, the slave is
+# synchronized with the master and (after the fix) it won't crash.
+# 
+  
+-- source include/master-slave.inc
+-- source include/have_binlog_format_row.inc
+
+#### sanity checks for tests in bug report (first two test cases) 
+
+### Test case #1 ###
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,t3;
+--enable_warnings
+
+CREATE TABLE t1 ( f1 integer , f2 int, primary key (f1)) ENGINE = MyISAM;
+CREATE TABLE t2 ( f1 integer , f2 int, primary key (f1)) ENGINE = MyISAM;
+CREATE TABLE t3 ( f1 integer , f2 int, primary key (f1)) ENGINE = MERGE UNION (t1,t2);
+INSERT IGNORE INTO t2 VALUES  (1, 1);
+# The UPDATE gets a crash with replication format mix and row
+UPDATE t3  SET `f2` = 7 LIMIT 1;
+SELECT * FROM t3;
+-- sync_slave_with_master
+
+-- connection master
+DROP TABLE t1, t2, t3;
+-- sync_slave_with_master
+
+-- connection master
+
+## Test case #2 ##
+
+-- source include/master-slave-reset.inc
+
+-- connection master
+CREATE TABLE `table0_int_autoinc` ( `int` int, pk integer
+                                     auto_increment, `int_key` int,
+                                     primary key (pk), key (`int_key`));
+
+CREATE TABLE `table10_int_autoinc` ( `int` int, pk integer
+                                      auto_increment, `int_key` int,
+                                      primary key (pk), key (`int_key`));
+
+INSERT IGNORE INTO table10_int_autoinc VALUES (NULL, NULL,
+'-474021888') , ('1', NULL, NULL) , ('1141047296', NULL, NULL) ,
+(NULL, NULL, NULL) , (NULL, NULL, '1') , (NULL, NULL, '9') , ('0',
+NULL, '1225785344') , (NULL, NULL, '1574174720') , ('2', NULL, NULL) ,
+('6', NULL, '3');
+
+CREATE TABLE IF NOT EXISTS t1_merge_1_A LIKE test.table0_int_autoinc;
+
+ALTER TABLE t1_merge_1_A ENGINE = MERGE UNION ( table10_int_autoinc , table0_int_autoinc);
+
+DELETE FROM t1_merge_1_A;
+
+-- sync_slave_with_master
+
+-- connection master
+DROP TABLE table0_int_autoinc, table10_int_autoinc, t1_merge_1_A;
+-- sync_slave_with_master
+
+-- connection master
+-- source include/master-slave-reset.inc
+-- connection master
+
+## Test case #3 ##
+
+CREATE TABLE t1 (a int);
+CREATE TABLE t2 (a int);
+INSERT INTO t1 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (4), (5), (6);
+CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
+ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+
+-- sync_slave_with_master
+
+-- let diff_table_1=master:test.t1
+-- let diff_table_2=slave:test.t1
+-- source include/diff_tables.inc
+
+-- let diff_table_1=master:test.t2
+-- let diff_table_2=slave:test.t2
+-- source include/diff_tables.inc
+
+-- connection master
+UPDATE t1_merge SET a=10 WHERE a=1;
+DELETE FROM t1_merge WHERE a=10;
+
+-- sync_slave_with_master
+
+-- let diff_table_1=master:test.t1
+-- let diff_table_2=slave:test.t1
+-- source include/diff_tables.inc
+
+-- let diff_table_1=master:test.t2
+-- let diff_table_2=slave:test.t2
+-- source include/diff_tables.inc
+
+-- sync_slave_with_master
+
+-- connection master
+DROP TABLE t1_merge, t1, t2;
+
+-- sync_slave_with_master

=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2009-09-25 14:15:30 +0000
+++ b/sql/log_event.cc	2009-10-09 10:03:25 +0000
@@ -7348,8 +7348,10 @@ int Rows_log_event::do_apply_event(Relay
 
     {
       RPL_TABLE_LIST *ptr= rli->tables_to_lock;
-      for ( ; ptr ; ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global))
+      for (uint i= 0 ; ptr && (i < rli->tables_to_lock_count); 
+           ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
       {
+        DBUG_ASSERT(ptr->m_tabledef_valid);
         if (ptr->m_tabledef.compatible_with(rli, ptr->table))
         {
           /*


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20091009100325-nypexvgjey462ba2.bundle
Thread
bzr commit into mysql-6.0-codebase-bugfixing branch (luis.soares:3654)Bug#47103Luis Soares9 Oct