• Jon Olav Hauglid's avatar
    Bug #11766788 (former bug 59986) · 6688a4f2
    Jon Olav Hauglid authored
    Assert in Diagnostics_area::set_ok_status() for XA COMMIT
    
    This assert was triggered if XA COMMIT was issued when an XA transaction
    already had encountered an error (e.g. a deadlock) which required
    the XA transaction to be rolled back.
    
    In general, the assert is triggered if a statement tries to send OK to
    the client when an error has already been reported. It was triggered
    in this case because the trans_xa_commit() function first reported an
    error, then rolled back the transaction and finally returned FALSE,
    indicating success. Since trans_xa_commit() reported success,
    mysql_execute_command() tried to report OK, triggering the assert.
    
    This patch fixes the problem by fixing trans_xa_commit() to return TRUE
    if it encounters an error that requires rollback, even if the rollback
    itself is successful.
    
    Test case added to xa.test.
    6688a4f2
transaction.cc 19.2 KB