List:Commits« Previous MessageNext Message »
From:Magne Mahre Date:September 23 2009 7:45pm
Subject:bzr commit into mysql-5.4.5-next-mr-bugfixing branch
(magne.mahre:2883) Bug#46539
View as plain text  
#At file:///data/z/mysql-next-mr-bugfixing-46539/ based on revid:alik@stripped

 2883 Magne Mahre	2009-09-23
      Bug #46539 Various crashes on INSERT IGNORE SELECT + SELECT 
                 FOR UPDATE
      
      If there is an active row-modifying transaction running
      when the connection is terminated, the server will
      issue an implicit rollback.  Since this rollback
      shouldn't return a status to the client, the m_status in
      the diagnostics area is set to DA_DISABLED.
      
      Trying to read the sql_errno from the diag.area is only
      permitted when the m_status is set to DA_ERROR, since the
      field otherwise has an undeterminable value.  An assert
      is protecting the field, and caused the crash seen here.
      
      The bug was fixed refraining from reading the sql_errno if
      the diag.area status is set to DA_DISABLED.
      
      A deterministic test case has been difficult to produce,
      and is not available at this time.   The RQG test case
      mentioned in the bug report  triggers the crash
      routinely.

    modified:
      sql/handler.cc
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2009-09-16 06:52:43 +0000
+++ b/sql/handler.cc	2009-09-23 19:45:15 +0000
@@ -1312,7 +1312,9 @@ int ha_rollback_trans(THD *thd, bool all
     }
     trans->ha_list= 0;
     trans->no_2pc=0;
-    if (is_real_trans && thd->transaction_rollback_request)
+    if (is_real_trans && 
+        thd->transaction_rollback_request &&
+        !thd->main_da.is_disabled())
       thd->transaction.xid_state.rm_error= thd->main_da.sql_errno();
     if (all)
       thd->variables.tx_isolation=thd->session_tx_isolation;


Attachment: [text/bzr-bundle] bzr/magne.mahre@sun.com-20090923194515-v73d639ayp90fwf8.bundle
Thread
bzr commit into mysql-5.4.5-next-mr-bugfixing branch(magne.mahre:2883) Bug#46539Magne Mahre23 Sep