Commit 14695b0c authored by heikki's avatar heikki

Merge r1046 from branches/5.0:

branches/5.0: trx_rollback_for_mysql(): Ensure that trx->sess is non-NULL
when calling trx_general_rollback_for_mysql().  This removes a segmentation
fault when rolling back a prepared transaction in XA recovery.  (Bug #21468)
parent f451c0b3
......@@ -131,8 +131,26 @@ trx_rollback_for_mysql(
trx->op_info = "rollback";
/* If we are doing the XA recovery of prepared transactions, then
the transaction object does not have an InnoDB session object, and we
must use a dummy session to get our rollback code to work. */
if (trx->sess == NULL) {
/* Open a dummy session */
if (!trx_dummy_sess) {
trx_dummy_sess = sess_open();
}
trx->sess = trx_dummy_sess;
}
err = trx_general_rollback_for_mysql(trx, FALSE, NULL);
if (trx->sess == trx_dummy_sess) {
trx->sess = NULL;
}
trx->op_info = "";
return(err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment