WL#6860: Binlogging XA-prepared transaction

Affects: Server-5.7   —   Status: Complete

This worklog adds support for XA-transactions to replication. An XA-transaction 
allows the client to participate in the two-phase commit protocol. The state of 
the XA-transaction being prepared is persisted in the database; i.e., a prepared 
XA-transaction will survive both a client reconnects or the server restarts.

Currently, a prepared XA-transaction will be lost after a client reconnects or 
the server restarts. Through this worklog, an XA-transaction will be binlogged
in two rounds:
R1)In the first round at XA-prepare the transaction is logged
as prepared but not yet committed. Its state is persisted in the Engine (Innodb).
R2)When finally the transaction gets committed (XA-commit) or rolled back
(XA-rollback) the second binlogging round completes the whole logging making
XA-commit/rollback into the binlog.

Therefore XA-transaction causes two GTIDs each assigned to the prepare or the
commit part in its round.
There may be other transactions (XA or not XA) binlogged in between the
XA-prepare part and the XA-commit/rollback part.

REFERENCES:
- BUG#12161