summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2022-03-10 13:59:13 +0100
committerJan Lindström <jan.lindstrom@mariadb.com>2022-04-20 10:41:19 +0300
commit11e5aba792b74c000d579240067992f0f274253d (patch)
tree8989343bb2d9b112dac34dba09035024ed4ece5d
parent89b1172373ff458ecb0032cb3b04aee6040a177b (diff)
downloadmariadb-git-11e5aba792b74c000d579240067992f0f274253d.tar.gz
MDEV-26575 Crash on shutdown after starting an XA transaction
Disallow XA when Galera library is loaded. Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
-rw-r--r--mysql-test/suite/galera/r/MDEV-26575.result8
-rw-r--r--mysql-test/suite/galera/t/MDEV-26575.test19
-rw-r--r--sql/sql_parse.cc2
3 files changed, 28 insertions, 1 deletions
diff --git a/mysql-test/suite/galera/r/MDEV-26575.result b/mysql-test/suite/galera/r/MDEV-26575.result
new file mode 100644
index 00000000000..b8d5d431aaa
--- /dev/null
+++ b/mysql-test/suite/galera/r/MDEV-26575.result
@@ -0,0 +1,8 @@
+connection node_2;
+connection node_1;
+connection node_1;
+connection node_2;
+connection node_2;
+SET SESSION wsrep_on = OFF;
+XA START 'xatest';
+ERROR 42000: This version of MariaDB doesn't yet support 'XA transactions with Galera replication'
diff --git a/mysql-test/suite/galera/t/MDEV-26575.test b/mysql-test/suite/galera/t/MDEV-26575.test
new file mode 100644
index 00000000000..e714f9fc430
--- /dev/null
+++ b/mysql-test/suite/galera/t/MDEV-26575.test
@@ -0,0 +1,19 @@
+#
+# MDEV-26575 Server crashes when execute shutdown statement after
+# starting an XA transaction
+#
+
+--source include/galera_cluster.inc
+
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
+
+--connection node_2
+SET SESSION wsrep_on = OFF;
+--error ER_NOT_SUPPORTED_YET
+XA START 'xatest';
+--source include/restart_mysqld.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e3efa2d051c..5471861c092 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -6047,7 +6047,7 @@ mysql_execute_command(THD *thd)
}
case SQLCOM_XA_START:
#ifdef WITH_WSREP
- if (WSREP(thd))
+ if (WSREP_ON)
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0),
"XA transactions with Galera replication");