WL#7193: Decouple THD and st_transactions

Affects: Server-5.7   —   Status: Complete

The current paradigm of handling transactions in the server is that a
transaction lives in the scope of connection. In other words, a transaction
can not outlive the connection where the transaction has been
started.

This paradigm does not allow XA JOIN / XA RESUME operations, since those
operations assume that a transaction can live longer than the initial
connection. Moreover, a transaction can change different connections.

Thus, in order to support operations XA JOIN/XA RESUME for distributed
transactions we need to change that paradigm and allow transaction context
to span outside its connection. That means that we need to decouple
connection context (represented by class THD) and transaction context
(represented by st_transactions structure).


User Documentation
==================

None required.