summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 0de772e366b..67ec5f3e759 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -817,7 +817,12 @@ int ha_rollback_trans(THD *thd, bool all)
trans->nht=0;
trans->no_2pc=0;
if (is_real_trans)
- thd->transaction.xid_state.xid.null();
+ {
+ if (thd->transaction_rollback_request)
+ thd->transaction.xid_state.rm_error= thd->net.last_errno;
+ else
+ thd->transaction.xid_state.xid.null();
+ }
if (all)
{
thd->variables.tx_isolation=thd->session_tx_isolation;