mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -81,3 +81,11 @@ xa rollback 'a';
|
|||||||
xa start 'a';
|
xa start 'a';
|
||||||
xa end 'a';
|
xa end 'a';
|
||||||
xa rollback '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';
|
||||||
|
@ -135,6 +135,20 @@ xa start 'a';
|
|||||||
xa end 'a';
|
xa end 'a';
|
||||||
xa rollback '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
|
# Wait till all disconnects are completed
|
||||||
--source include/wait_until_count_sessions.inc
|
--source include/wait_until_count_sessions.inc
|
||||||
|
|
||||||
|
@ -1242,9 +1242,10 @@ int ha_commit_one_phase(THD *thd, bool all)
|
|||||||
#endif
|
#endif
|
||||||
thd->variables.tx_isolation=thd->session_tx_isolation;
|
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 */
|
#endif /* USING_TRANSACTIONS */
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user