From: Jon Olav Hauglid Date: September 13 2010 9:23am Subject: bzr commit into mysql-5.5-runtime branch (jon.hauglid:3136) Bug#56448 List-Archive: http://lists.mysql.com/commits/118057 X-Bug: 56448 Message-Id: <201009130923.o8D7N9fe021993@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7197928426945655414==" --===============7197928426945655414== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///export/home/x/mysql-5.5-runtime-bug56448/ based on revid:jon.hauglid@stripped 3136 Jon Olav Hauglid 2010-09-13 Bug #56448 Assertion failed: ! is_set() with second xa end The problem was that issuing XA END when the XA transaction was already ended, caused an assertion. This assertion tests that the server does not try to send OK to the client if there has already been an error reported. The bug was only noticeable on debug versions of the server. The reason for the problem was that the trans_xa_end() function reported success if the transaction was at XA_IDLE state at the end regardless of any errors occured during processing of trans_xa_end(). So if the transaction state was XA_IDLE already, reported errors would be ignored. This patch fixes the problem by having trans_xa_end() take into consideration any reported errors. Test case added to xa.test. modified: mysql-test/r/xa.result mysql-test/t/xa.test sql/transaction.cc === modified file 'mysql-test/r/xa.result' --- a/mysql-test/r/xa.result 2010-03-10 15:31:22 +0000 +++ b/mysql-test/r/xa.result 2010-09-13 09:23:00 +0000 @@ -131,3 +131,10 @@ XA START 'xid1'; XA END 'xid1'; XA ROLLBACK 'xid1'; DROP TABLE t1; +# +# Bug#56448 Assertion failed: ! is_set() with second xa end +# +XA START 'x'; +XA END 'x'; +XA END 'x'; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state === modified file 'mysql-test/t/xa.test' --- a/mysql-test/t/xa.test 2010-03-24 15:03:44 +0000 +++ b/mysql-test/t/xa.test 2010-09-13 09:23:00 +0000 @@ -228,6 +228,18 @@ XA ROLLBACK 'xid1'; disconnect con1; DROP TABLE t1; + +--echo # +--echo # Bug#56448 Assertion failed: ! is_set() with second xa end +--echo # + +XA START 'x'; +XA END 'x'; +# Second XA END caused an assertion. +--error ER_XAER_RMFAIL +XA END 'x'; + + # Wait till all disconnects are completed --source include/wait_until_count_sessions.inc === modified file 'sql/transaction.cc' --- a/sql/transaction.cc 2010-07-27 10:25:53 +0000 +++ b/sql/transaction.cc 2010-09-13 09:23:00 +0000 @@ -565,7 +565,8 @@ bool trans_xa_end(THD *thd) else if (!xa_trans_rolled_back(&thd->transaction.xid_state)) thd->transaction.xid_state.xa_state= XA_IDLE; - DBUG_RETURN(thd->transaction.xid_state.xa_state != XA_IDLE); + DBUG_RETURN(thd->is_error() || + thd->transaction.xid_state.xa_state != XA_IDLE); } --===============7197928426945655414== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/jon.hauglid@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: jon.hauglid@stripped # target_branch: file:///export/home/x/mysql-5.5-runtime-bug56448/ # testament_sha1: c91bb26d7201e9da0a253f72e0df4640c2d80a42 # timestamp: 2010-09-13 11:23:03 +0200 # source_branch: file:///export/home/x/mysql-5.5-bugfixing/ # base_revision_id: jon.hauglid@stripped\ # g410ntzqvdpayclt # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWbp2RMsAAz3fgEAQeOf//3f/ nkC////0YAeV1dvuq6DxO9tvcdXme5MyDsawkkjSCek9qJmqflGnpoU/VPFP1NPVHqAMaRo0HqBK KT0mmMIBqp+qbyptNR6h6T9UDJ6gxAAHqDKmR6KemmppNNqHqZAaYTRiZDBGEAaBIiEFM0mU8mTF NG0mjTUPU9RkAaND1AaHGTJkxGJgBMmCZADRhGAIYBJIEyExNDVT/KaYU2UE2mkNGhtRpkA0yKHe q4v4qUMxMyZT5/HD6cxjPyXN7myVaoUhBlEc52B53J2D8jgMjC8pc0CvGzpK45sr31YYdJ3t5sSG L0poLjavvb38l+i1ptttrR8QypaY88xEwujXST27iLWj0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