List:Commits« Previous MessageNext Message »
From:guilhem Date:July 3 2006 2:35pm
Subject:bk commit into 5.1 tree (guilhem:1.2232) BUG#18590
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of guilhem. When guilhem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2232 06/07/03 16:35:51 guilhem@stripped +3 -0
  Fix for BUG#20649 "mixed replication mode does not work with INSERT DELAYED".
  The bug was that if the server was running in mixed binlogging mode,
  and an INSERT DELAYED used some needing-row-based components like UUID(),
  the server didn't binlog this row-based but statement-based.
  As the delayed_insert thread does some grouping of rows, some could need
  row-based and some others, but the generation of row-based table map events
  happens early (before locking the tables), we cannot easily binlog some
  rows statement-based and some other row-based.
  So this changeset implements that when a delayed_insert thread is created,
  if the server's global binlog mode is "mixed", that thread will use row-based.
  To test this, we re-enable rpl_switch_stm_row_mixed.test (so BUG#18590
  which was about re-enabling this test, will be closed).
  Between when it was disabled and now, some good changes to row-based
  binlogging (no generation of table map events for non-changed tables)
  induce changes in the test's result file.

  sql/sql_insert.cc
    1.208 06/07/03 16:35:40 guilhem@stripped +14 -0
    In mixed binlogging mode, the delayed_insert system thread now always
    uses row-based binlogging.

  mysql-test/t/rpl_switch_stm_row_mixed.test
    1.5 06/07/03 16:35:40 guilhem@stripped +7 -0
    testing fix to make INSERT DELAYED work in mixed mode

  mysql-test/t/disabled.def
    1.171 06/07/03 16:35:40 guilhem@stripped +0 -1
    this test works now

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	guilhem
# Host:	gbichot3.local
# Root:	/home/mysql_src/mysql-5.1

--- 1.207/sql/sql_insert.cc	2006-07-01 06:19:16 +02:00
+++ 1.208/sql/sql_insert.cc	2006-07-03 16:35:40 +02:00
@@ -1290,6 +1290,20 @@
     thd.command=COM_DELAYED_INSERT;
     thd.lex->current_select= 0; 		// for my_message_sql
     thd.lex->sql_command= SQLCOM_INSERT;        // For innodb::store_lock()
+#ifdef HAVE_ROW_BASED_REPLICATION
+    /*
+      In mixed binlogging mode, some rows may require row-based, some would
+      be ok with statement-based.  But if the two types are in the same
+      bunch, given that the generation of row-based table map events happens
+      at table locking time, we would have to analyze the bunch before
+      locking the table, to know if at least one row need row-based. Or we
+      would have, when we queue a row, to be sure to create a new bunch if
+      the row must be row-based and the others ones in the queue were
+      statement-based. This is complicated, so we simply say that in mixed
+      binlogging mode, the delayed inserts always happen in row-based.
+    */
+    thd.set_current_stmt_binlog_row_based_if_mixed();
+#endif
 
     bzero((char*) &thd.net, sizeof(thd.net));		// Safety
     bzero((char*) &table_list, sizeof(table_list));	// Safety

--- 1.4/mysql-test/t/rpl_switch_stm_row_mixed.test	2006-03-13 15:34:15 +01:00
+++ 1.5/mysql-test/t/rpl_switch_stm_row_mixed.test	2006-07-03 16:35:40 +02:00
@@ -154,6 +154,13 @@
 select foo3();
 select * from t1 where a="alarm";
 
+# Test that INSERT DELAYED works in mixed mode
+insert delayed into t2 values("delay_1_");
+insert delayed into t2 values(concat("delay_2_",UUID()));
+insert delayed into t2 values("delay_3_"),(concat("delay_4_",UUID())),("delay_5_");
+insert delayed into t2 values("delay_6_");
+sleep 4; # time for the delayed insert to reach disk
+
 # If you want to do manual testing of the mixed mode regarding UDFs (not
 # testable automatically as quite platform- and compiler-dependent),
 # you just need to set the variable below to 1, and to

--- 1.170/mysql-test/t/disabled.def	2006-06-27 01:38:38 +02:00
+++ 1.171/mysql-test/t/disabled.def	2006-07-03 16:35:40 +02:00
@@ -32,7 +32,6 @@
 rpl_ndb_innodb2ndb       : Bug #19710  Cluster replication to partition table fails on DELETE FROM statement
 #rpl_ndb_log              : BUG#18947 2006-03-21 tomas CRBR: order in binlog of create table and insert (on different table) not determ
 rpl_ndb_myisam2ndb       : Bug #19710  Cluster replication to partition table fails on DELETE FROM statement
-rpl_switch_stm_row_mixed : BUG#18590 2006-03-28 brian
 rpl_row_blob_innodb      : BUG#18980 2006-04-10 kent    Test fails randomly
 rpl_row_func003          : BUG#19074 2006-13-04 andrei  test failed
 rpl_sp                   : BUG#16456 2006-02-16 jmiller
Thread
bk commit into 5.1 tree (guilhem:1.2232) BUG#18590guilhem3 Jul