From 04741dc736e803b0a91c76d19de464e25b4a1977 Mon Sep 17 00:00:00 2001 From: Daniele Sciascia Date: Mon, 21 Dec 2020 14:44:56 +0100 Subject: [PATCH] MENT-1047 Assertion `active() == false' failed with "XA START.." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Galera replication does not support XA transactions yet. Reject any attempt to `XA START` a transaction, if Galera is enabled. Reviewed-by: Jan Lindström --- mysql-test/suite/galera/r/MENT-1047.result | 4 ++++ mysql-test/suite/galera/t/MENT-1047.test | 7 +++++++ sql/sql_parse.cc | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 mysql-test/suite/galera/r/MENT-1047.result create mode 100644 mysql-test/suite/galera/t/MENT-1047.test diff --git a/mysql-test/suite/galera/r/MENT-1047.result b/mysql-test/suite/galera/r/MENT-1047.result new file mode 100644 index 00000000000..76d58f6d52f --- /dev/null +++ b/mysql-test/suite/galera/r/MENT-1047.result @@ -0,0 +1,4 @@ +connection node_2; +connection node_1; +XA START 'trx'; +ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication' diff --git a/mysql-test/suite/galera/t/MENT-1047.test b/mysql-test/suite/galera/t/MENT-1047.test new file mode 100644 index 00000000000..1431818f806 --- /dev/null +++ b/mysql-test/suite/galera/t/MENT-1047.test @@ -0,0 +1,7 @@ +# +# MENT-1047 - Reject XA with Galera replication +# +--source include/galera_cluster.inc + +--error ER_NOT_SUPPORTED_YET +XA START 'trx'; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 036c1215ea6..472dc3b386a 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5987,6 +5987,14 @@ mysql_execute_command(THD *thd) break; } case SQLCOM_XA_START: +#ifdef WITH_WSREP + if (WSREP(thd)) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), + "XA transactions with Galera replication"); + break; + } +#endif /* WITH_WSREP */ if (trans_xa_start(thd)) goto error; my_ok(thd);