#include <string.h>
#include <sys/types.h>
#include <list>
#include <mutex>
#include "lex_string.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_sqlcommand.h"
#include "sql/malloc_allocator.h"
#include "sql/psi_memory_key.h"
#include "sql/sql_cmd.h"
#include "sql/sql_list.h"
#include "sql/sql_plugin_ref.h"
#include "sql/xa_aux.h"
Go to the source code of this file.
|
class | Sql_cmd_xa_start |
| This class represents SQL statement which starts an XA transaction with the given xid value. More...
|
|
class | Sql_cmd_xa_end |
| This class represents SQL statement which puts in the IDLE state an XA transaction with the given xid value. More...
|
|
class | Sql_cmd_xa_prepare |
| This class represents SQL statement which puts in the PREPARED state an XA transaction with the given xid value. More...
|
|
class | Sql_cmd_xa_recover |
| This class represents SQL statement which returns to a client a list of XID's prepared to a XA commit/rollback. More...
|
|
class | Sql_cmd_xa_commit |
| This class represents SQL statement which commits and terminates an XA transaction with the given xid value. More...
|
|
class | Sql_cmd_xa_rollback |
| This class represents SQL statement which rollbacks and terminates an XA transaction with the given xid value. More...
|
|
struct | xid_t |
| struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification, Distributed Transaction Processing: The XA Specification, X/Open Company Ltd., 1991. More...
|
|
struct | st_xarecover_txn |
| Plain structure to store information about XA transaction id and a list of table names involved into XA transaction with specified id. More...
|
|
class | XID_STATE |
|
class | Recovered_xa_transactions |
| This class servers as a registry for prepared XA transactions existed before server was shutdown and being resurrected during the server restart. More...
|
|
|
typedef int64 | query_id_t |
|
typedef ulonglong | my_xid |
|
typedef struct xid_t | XID |
| struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification, Distributed Transaction Processing: The XA Specification, X/Open Company Ltd., 1991. More...
|
|
typedef struct st_xarecover_txn | XA_recover_txn |
| Plain structure to store information about XA transaction id and a list of table names involved into XA transaction with specified id. More...
|
|
◆ MYSQL_XID_PREFIX
#define MYSQL_XID_PREFIX "MySQLXid" |
◆ XIDDATASIZE
◆ my_xid
◆ query_id_t
◆ XA_recover_txn
Plain structure to store information about XA transaction id and a list of table names involved into XA transaction with specified id.
◆ XID
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification, Distributed Transaction Processing: The XA Specification, X/Open Company Ltd., 1991.
http://www.opengroup.org/bookstore/catalog/c193.htm
- See also
- MYSQL_XID in mysql/plugin.h
◆ xa_option_words
Enumerator |
---|
XA_NONE | |
XA_JOIN | |
XA_RESUME | |
XA_ONE_PHASE | |
XA_SUSPEND | |
XA_FOR_MIGRATE | |
◆ applier_reset_xa_trans()
bool applier_reset_xa_trans |
( |
THD * |
thd | ) |
|
This is a specific to "slave" applier collection of standard cleanup actions to reset XA transaction state at the end of XA prepare rather than to do it at the transaction commit, see ha_commit_one_phase
.
THD of the slave applier is dissociated from a transaction object in engine that continues to exist there.
- Parameters
-
- Returns
- the value of is_error()
◆ cleanup_trans_state()
void cleanup_trans_state |
( |
THD * |
thd | ) |
|
Reset some transaction state information and delete corresponding Transaction_ctx object from cache.
- Parameters
-
◆ detach_native_trx()
The function detaches existing storage engines transaction context from thd.
Backup area to save it is provided to low level storage engine function.
is invoked by plugin_foreach() after trans_xa_start() for each storage engine.
- Parameters
-
[in,out] | thd | Thread context |
| plugin | Reference to handlerton |
- Returns
- false on success, true otherwise.
◆ disconnect_native_trx()
bool disconnect_native_trx |
( |
THD * |
thd, |
|
|
plugin_ref |
plugin, |
|
|
void * |
|
|
) |
| |
Disconnect transaction in SE.
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. Signature matches that required by plugin_foreach.
◆ plugin_find_by_type()
Searches for a correctly loaded plugin of a particular type by name.
- Parameters
-
plugin | the name of the plugin we're looking for |
type | type of the plugin (0-MYSQL_MAX_PLUGIN_TYPE_NUM) |
- Returns
- plugin, or NULL if not found
◆ reattach_native_trx()
bool reattach_native_trx |
( |
THD * |
thd, |
|
|
plugin_ref |
plugin, |
|
|
void * |
|
|
) |
| |
The function reattaches existing storage engines transaction context to thd.
Backup area to save it is provided to low level storage engine function.
is invoked by plugin_foreach() after trans_xa_prepare() for each storage engine.
- Parameters
-
[in,out] | thd | Thread context |
| plugin | Reference to handlerton |
- Returns
- false on success, true otherwise.
◆ transaction_cache_delete()
Remove information about transaction from a cache.
- Parameters
-
transaction | Pointer to a Transaction_ctx that has to be removed from a cache. |
◆ transaction_cache_detach()
Transaction is marked in the cache as if it's recovered.
The method allows to sustain prepared transaction disconnection.
- Parameters
-
transaction | Pointer to Transaction object that is replaced. |
- Returns
- operation result
- Return values
-
false | success or a cache already contains XID_STATE for this XID value |
true | failure |
◆ transaction_cache_free()
void transaction_cache_free |
( |
| ) |
|
Release resources occupied by transaction cache.
◆ transaction_cache_init()
bool transaction_cache_init |
( |
| ) |
|
Initialize a cache to store Transaction_ctx and a mutex to protect access to the cache.
- Returns
- result of initialization
- Return values
-
◆ xa_trans_force_rollback()
bool xa_trans_force_rollback |
( |
THD * |
thd | ) |
|
Rollback the active XA transaction.
- Note
- Resets rm_error before calling ha_rollback(), so the thd->transaction.xid structure gets reset by ha_rollback() / THD::transaction::cleanup().
- Returns
- true if the rollback failed, false otherwise.
◆ TC_HEURISTIC_NOT_USED
const int TC_HEURISTIC_NOT_USED = 0 |
|
static |
◆ TC_HEURISTIC_RECOVER_COMMIT
const int TC_HEURISTIC_RECOVER_COMMIT = 1 |
|
static |
◆ TC_HEURISTIC_RECOVER_ROLLBACK
const int TC_HEURISTIC_RECOVER_ROLLBACK = 2 |
|
static |