1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-35019 Provide a way to enable "rollback XA on disconnect" behavior we had before 10.5.2

Implement variable legacy_xa_rollback_at_disconnect to support
backwards compatibility for applications that rely on the pre-10.5
behavior for connection disconnect, which is to rollback the
transaction (in violation of the XA specification).

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2024-10-10 20:52:45 +02:00
parent e927e28ebe
commit 8ae462a220
12 changed files with 152 additions and 1 deletions

View File

@ -1553,7 +1553,12 @@ void THD::cleanup(void)
close_temporary_tables();
if (transaction->xid_state.is_explicit_XA())
trans_xa_detach(this);
{
if (unlikely(variables.legacy_xa_rollback_at_disconnect))
xa_trans_force_rollback(this);
else
trans_xa_detach(this);
}
else
trans_rollback(this);