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