#include <xa.h>
◆ xa_states
Enumerator |
---|
XA_NOTR | |
XA_ACTIVE | |
XA_IDLE | |
XA_PREPARED | |
XA_ROLLBACK_ONLY | |
◆ XID_STATE()
◆ check_has_uncommitted_xa()
bool XID_STATE::check_has_uncommitted_xa |
( |
| ) |
const |
Check that XA transaction has an uncommitted work.
Report an error to a mysql user in case when there is an uncommitted work for XA transaction.
- Returns
- result of check
- Return values
-
false | XA transaction is NOT in state IDLE, PREPARED or ROLLBACK_ONLY. |
true | XA transaction is in state IDLE or PREPARED or ROLLBACK_ONLY. |
◆ check_in_xa()
bool XID_STATE::check_in_xa |
( |
bool |
report_error | ) |
const |
Check if an XA transaction has been started.
- Parameters
-
report_error | true if report an error in case when XA transaction has been stared, else false. |
- Returns
- result of check
- Return values
-
false | XA transaction hasn't been started (XA_NOTR) |
true | XA transaction has been started (!XA_NOTR) |
◆ check_xa_idle_or_prepared()
bool XID_STATE::check_xa_idle_or_prepared |
( |
bool |
report_error | ) |
const |
Check that XA transaction is in state IDLE or PREPARED.
- Parameters
-
report_error | true if state IDLE or PREPARED has to be interpreted as an error, else false |
- Returns
- result of check
- Return values
-
false | XA transaction is NOT in state IDLE or PREPARED |
true | XA transaction is in state IDLE or PREPARED |
◆ cleanup()
void XID_STATE::cleanup |
( |
void |
| ) |
|
|
inline |
◆ get_state()
◆ get_xa_lock()
std::mutex & XID_STATE::get_xa_lock |
( |
| ) |
|
|
inline |
◆ get_xid() [1/2]
XID * XID_STATE::get_xid |
( |
| ) |
|
|
inline |
◆ get_xid() [2/2]
const XID * XID_STATE::get_xid |
( |
| ) |
const |
|
inline |
◆ has_same_xid()
bool XID_STATE::has_same_xid |
( |
const XID * |
xid | ) |
const |
|
inline |
◆ has_state()
bool XID_STATE::has_state |
( |
xa_states |
state | ) |
const |
|
inline |
◆ is_binlogged()
bool XID_STATE::is_binlogged |
( |
| ) |
const |
|
inline |
◆ is_detached()
bool XID_STATE::is_detached |
( |
| ) |
const |
|
inline |
◆ reset()
void XID_STATE::reset |
( |
void |
| ) |
|
|
inline |
◆ reset_error()
void XID_STATE::reset_error |
( |
| ) |
|
|
inline |
◆ set_binlogged()
void XID_STATE::set_binlogged |
( |
| ) |
|
|
inline |
◆ set_error()
void XID_STATE::set_error |
( |
THD * |
thd | ) |
|
◆ set_query_id()
void XID_STATE::set_query_id |
( |
query_id_t |
query_id | ) |
|
|
inline |
◆ set_state()
◆ start_detached_xa()
void XID_STATE::start_detached_xa |
( |
const XID * |
xid, |
|
|
bool |
binlogged_arg = false |
|
) |
| |
|
inline |
◆ start_normal_xa()
void XID_STATE::start_normal_xa |
( |
const XID * |
xid | ) |
|
|
inline |
◆ state_name()
const char * XID_STATE::state_name |
( |
| ) |
const |
|
inline |
◆ store_xid_info()
void XID_STATE::store_xid_info |
( |
Protocol * |
protocol, |
|
|
bool |
print_xid_as_hex |
|
) |
| const |
◆ unset_binlogged()
void XID_STATE::unset_binlogged |
( |
| ) |
|
|
inline |
◆ xa_trans_rolled_back()
bool XID_STATE::xa_trans_rolled_back |
( |
| ) |
|
Mark a XA transaction as rollback-only if the RM unilaterally rolled back the transaction branch.
- Note
- If a rollback was requested by the RM, this function sets the appropriate rollback error code and transits the state to XA_ROLLBACK_ONLY.
- Returns
- true if transaction was rolled back or if the transaction state is XA_ROLLBACK_ONLY. false otherwise.
◆ m_is_binlogged
bool XID_STATE::m_is_binlogged |
|
private |
◆ m_is_detached
bool XID_STATE::m_is_detached = false |
|
private |
◆ m_xa_lock
std::mutex XID_STATE::m_xa_lock |
|
private |
This mutex used for eliminating a possibility to run two XA COMMIT/XA ROLLBACK statements concurrently against the same xid value.
m_xa_lock is used on handling XA COMMIT/XA ROLLBACK and acquired only for external XA branches.
◆ m_xid
◆ rm_error
Error reported by the Resource Manager (RM) to the Transaction Manager.
◆ xa_state
Used by external XA only.
◆ xa_state_names
const char * XID_STATE::xa_state_names |
|
staticprivate |
Initial value:= {"NON-EXISTING", "ACTIVE", "IDLE",
"PREPARED", "ROLLBACK ONLY"}
Transaction identifier.
For now, this is only used to catch duplicated external xids.
The documentation for this class was generated from the following files: