Prepared XA transaction gets lost on restart

Description

On a crash the prepared XA transactions get recovered, but on restart they don't

mysql [test] > CREATE TABLE t1 (id int) ENGINE=TokuDB;
Query OK, 0 rows affected (0.01 sec)

mysql [test] > XA RECOVER;
Empty set (0.00 sec)

mysql [test] > XA START 'foo-3';
Query OK, 0 rows affected (0.00 sec)

mysql [test] > INSERT INTO t1 VALUES(1);
Query OK, 1 row affected (0.01 sec)

mysql [test] > XA END 'foo-3';
Query OK, 0 rows affected (0.00 sec)

mysql [test] > XA PREPARE 'foo-3';
Query OK, 0 rows affected (0.00 sec)

mysql [test] > XA RECOVER;
---------------------------------------------+

formatID

gtrid_length

bqual_length

data

---------------------------------------------+

1

5

0

foo-3

---------------------------------------------+
1 row in set (0.00 sec)

mysql [test] > ! ./restart

mysql [test] > XA RECOVER;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test

Empty set (0.00 sec)

mysql [test] > XA START 'foo-4';
Query OK, 0 rows affected (0.00 sec)

mysql [test] > INSERT INTO t1 VALUES(2);
Query OK, 1 row affected (0.00 sec)

mysql [test] > XA END 'foo-4';
Query OK, 0 rows affected (0.00 sec)

mysql [test] > XA PREPARE 'foo-4';
Query OK, 0 rows affected (0.00 sec)

kill -9 on mysqld and mysqld_safe...

mysql [test] > XA RECOVER;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: test

---------------------------------------------+

formatID

gtrid_length

bqual_length

data

---------------------------------------------+

1

5

0

foo-4

---------------------------------------------+
1 row in set (0.00 sec)

mysql [test] > select version();
---------------------

version()

---------------------

5.5.40-tokudb-7.5.3

---------------------
1 row in set (0.00 sec)

Environment

None

Assignee

Unassigned

Reporter

Daniël van Eeden

Labels

None

External issue ID

None

Freshdesk Tickets

None

Components

Affects versions

Priority

Minor
Configure