List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:June 26 2009 3:18pm
Subject:bzr commit into mysql-5.1-bugteam branch (davi:2980) Bug#45548
View as plain text  
# At a local mysql-5.1-bugteam repository of davi

 2980 Davi Arnaut	2009-06-25
      Bug#45548: XA transaction without access to InnoDB tables crashes the server
      
      The problem is that the one phase commit function failed to
      properly end a empty transaction. The solution is to ensure
      that the transaction cleanup procedure is invoked even for
      empty transactions.
     @ mysql-test/r/xa.result
        Add test case result for Bug#45548
     @ mysql-test/t/xa.test
        Add test case for Bug#45548
     @ sql/handler.cc
        Invoke transaction cleanup function whenever a transaction is ended.

    modified:
      mysql-test/r/xa.result
      mysql-test/t/xa.test
      sql/handler.cc
=== modified file 'mysql-test/r/xa.result'
--- a/mysql-test/r/xa.result	2009-06-05 22:16:54 +0000
+++ b/mysql-test/r/xa.result	2009-06-25 15:25:23 +0000
@@ -81,3 +81,11 @@ xa rollback 'a';
 xa start 'a';
 xa end 'a';
 xa rollback 'a';
+xa start 'a';
+xa end 'a';
+xa prepare 'a';
+xa commit 'a';
+xa start 'a';
+xa end 'a';
+xa prepare 'a';
+xa commit 'a';

=== modified file 'mysql-test/t/xa.test'
--- a/mysql-test/t/xa.test	2009-06-05 22:16:54 +0000
+++ b/mysql-test/t/xa.test	2009-06-25 15:25:23 +0000
@@ -135,6 +135,20 @@ xa start 'a';
 xa end 'a';
 xa rollback 'a';
 
+#
+# Bug#45548: XA transaction without access to InnoDB tables crashes the server
+#
+
+xa start 'a';
+xa end 'a';
+xa prepare 'a';
+xa commit 'a';
+
+xa start 'a';
+xa end 'a';
+xa prepare 'a';
+xa commit 'a';
+
 # Wait till all disconnects are completed
 --source include/wait_until_count_sessions.inc
 

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2009-06-19 08:24:43 +0000
+++ b/sql/handler.cc	2009-06-25 15:25:23 +0000
@@ -1242,9 +1242,10 @@ int ha_commit_one_phase(THD *thd, bool a
 #endif
       thd->variables.tx_isolation=thd->session_tx_isolation;
     }
-    if (is_real_trans)
-      thd->transaction.cleanup();
   }
+  /* Free resources and perform other cleanup even for 'empty' transactions. */
+  if (is_real_trans)
+    thd->transaction.cleanup();
 #endif /* USING_TRANSACTIONS */
   DBUG_RETURN(error);
 }


Attachment: [text/bzr-bundle] bzr/davi.arnaut@sun.com-20090625152523-d5k8ntkzlgwwuks1.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (davi:2980) Bug#45548Davi Arnaut26 Jun
  • Re: bzr commit into mysql-5.1-bugteam branch (davi:2980) Bug#45548Konstantin Osipov27 Jun