MySQL 8.0.40
Source Code Documentation
anonymous_namespace{sql_xa_prepare.cc} Namespace Reference

Functions

int process_xa_prepare (THD *thd)
 The main processing function for XA PREPARE: More...
 
bool detach_xa_transaction (THD *thd)
 Detaches the active XA transaction from the current THD session. More...
 
bool detach_native_trx_one_ht (THD *thd, handlerton *hton)
 Detaches the transaction held by the THD session object from the storage engine represented by hton. More...
 
void reset_xa_connection (THD *thd)
 Reset the THD session object after XA transaction is detached, in order to make it usable for "new" work, normal statements or a new XA transaction. More...
 

Function Documentation

◆ detach_native_trx_one_ht()

bool anonymous_namespace{sql_xa_prepare.cc}::detach_native_trx_one_ht ( THD thd,
handlerton hton 
)

Detaches the transaction held by the THD session object from the storage engine represented by hton.

This the same action which is performed by SE when disconnecting a connection which has a prepared XA transaction, when xa_detach_on_prepare is OFF.

Parameters
thdThe THD session object holding the transaction to be detached.
htonThe handlerton object representing the SE for which the transaction must be detached.
Returns
false if the transaction has been successfully detached, true otherwise.

◆ detach_xa_transaction()

bool anonymous_namespace{sql_xa_prepare.cc}::detach_xa_transaction ( THD thd)

Detaches the active XA transaction from the current THD session.

Executes the following actions:

  1. Creates an MDL context backup.
  2. Adds the transaction to the XA transaction cache.
  3. Detaches the underlying native SE transaction.
Parameters
thdThe THD session object holding the transaction to be detached.
Returns
false if the transaction has been successfully detached, true otherwise.

◆ process_xa_prepare()

int anonymous_namespace{sql_xa_prepare.cc}::process_xa_prepare ( THD thd)

The main processing function for XA PREPARE:

  1. Iterates over all storage engines that participate in the transaction that are not the binary log and commands each to prepare.
  2. Prepares the transaction in the binary log, writing the XA PREPARE associated event to the current binlog.
Parameters
thdThe THD session object within which the command is being executed.
Returns
0 if the transaction was successfully prepared, > 0 otherwise.

◆ reset_xa_connection()

void anonymous_namespace{sql_xa_prepare.cc}::reset_xa_connection ( THD thd)

Reset the THD session object after XA transaction is detached, in order to make it usable for "new" work, normal statements or a new XA transaction.

Parameters
thdThe THD session object to be reset and cleaned up.