Bug #121452 XA PREPARE causes connection lost
Submitted: 7 Oct 19:25
Reporter: Jiyuan Li Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:|26.10.0-cluster OS:Ubuntu (24.04)
Assigned to: CPU Architecture:Any

[7 Oct 19:25] Jiyuan Li
Description:
Executing XA transaction causes connection lost. 

How to repeat:
mysql> create database d0;
Query OK, 1 row affected (0.04 sec)

mysql> use d0;
Database changed
mysql>   CREATE TABLE t (id INT PRIMARY KEY, v INT) ENGINE=NDB;
Query OK, 0 rows affected (0.19 sec)

mysql> INSERT INTO t VALUES (1,1);
Query OK, 1 row affected (0.00 sec)

mysql> XA START 'fbx';
Query OK, 0 rows affected (0.00 sec)

mysql>   SELECT COUNT(*) FROM t;   -- a read-only statement is enough
+----------+
| COUNT(*) |
+----------+
|        1 |
+----------+
1 row in set (0.00 sec)

mysql> XA END 'fbx';
Query OK, 0 rows affected (0.00 sec)

mysql>   XA PREPARE 'fbx';         -- <== mysqld crashes here
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 2
ERROR: 
Can't connect to the server