List:Commits« Previous MessageNext Message »
From:cbell Date:August 30 2007 7:35pm
Subject:bk commit into 5.0 tree (cbell:1.2499) BUG#26395
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of cbell. When cbell 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@stripped, 2007-08-30 15:34:50-04:00, cbell@mysql_cab_desk. +1 -0
  BUG#26395 : if crash during autocommit update to transactional table on master, slave fails
  
  This patch ensures that a BEGIN statement is written every time the method
  MYSQL_LOG::write() there is called with a transactional engine present.

  sql/log.cc@stripped, 2007-08-30 15:34:48-04:00, cbell@mysql_cab_desk. +6 -2
    BUG#26395 : if crash during autocommit update to transactional table on master, slave fails
    
    This patch adds a condition to the code to write the "BEGIN" 
    statement every time the method MYSQL_LOG::write(THD *thd, 
    IO_CACHE *cache, Log_event *commit_event) is called with a 
    transactional engine present.

diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc	2007-07-30 11:27:30 -04:00
+++ b/sql/log.cc	2007-08-30 15:34:48 -04:00
@@ -1842,8 +1842,13 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE
     /*
       Log "BEGIN" at the beginning of the transaction.
       which may contain more than 1 SQL statement.
+
+      We also need to write the "BEGIN" if we are using transactional
+      engines (nht == 1 whenever binlog_start_trans_and_stmt() is called)
+      indicated by nht > 1 in the st_thd_trans (THD_TRANS) structure.
     */
-    if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))
+    if ((thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) ||
+        (thd->transaction.stmt.nht > 1))
     {
       Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"), TRUE, FALSE);
       /*
@@ -1871,7 +1876,6 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE
       goto err;
 
     length= my_b_bytes_in_cache(cache);
-    DBUG_EXECUTE_IF("half_binlogged_transaction", length-=100;);
 
     /*
       The events in the buffer have incorrect end_log_pos data

Thread
bk commit into 5.0 tree (cbell:1.2499) BUG#26395cbell30 Aug
  • Re: bk commit into 5.0 tree (cbell:1.2499) BUG#26395Andrei Elkin31 Aug
  • Re: bk commit into 5.0 tree (cbell:1.2499) BUG#26395Mats Kindahl22 Oct