MySQL  8.0.22
Source Code Documentation
TrxInInnoDB Class Reference

Track if a transaction is executing inside InnoDB code. More...

#include <trx0trx.h>

Public Member Functions

 TrxInInnoDB (trx_t *trx, bool disable=false)
 
 ~TrxInInnoDB ()
 Destructor. More...
 
bool is_aborted () const
 
bool is_rollback_disabled () const
 

Static Public Member Functions

static bool is_aborted (const trx_t *trx)
 
static void begin_stmt (trx_t *trx)
 Start statement requested for transaction. More...
 
static void end_stmt (trx_t *trx)
 Note an end statement for transaction. More...
 
static bool is_async_rollback (const trx_t *trx)
 

Static Private Member Functions

static void enter (trx_t *trx, bool disable)
 Note that we have crossed into InnoDB code. More...
 
static void exit (trx_t *trx)
 Note that we are exiting InnoDB code. More...
 
static bool is_forced_rollback (const trx_t *trx)
 
static void wait (const trx_t *trx)
 Wait for the asynchronous rollback to complete, if it is in progress. More...
 
static bool is_started (const trx_t *trx)
 

Private Attributes

trx_tm_trx
 Transaction instance crossing the handler boundary from the Server. More...
 

Detailed Description

Track if a transaction is executing inside InnoDB code.

It acts like a gate between the Server and InnoDB.

Constructor & Destructor Documentation

◆ TrxInInnoDB()

TrxInInnoDB::TrxInInnoDB ( trx_t trx,
bool  disable = false 
)
inline
Parameters
[in,out]trxTransaction entering InnoDB via the handler
[in]disabletrue if called from COMMIT/ROLLBACK method

◆ ~TrxInInnoDB()

TrxInInnoDB::~TrxInInnoDB ( )
inline

Destructor.

Member Function Documentation

◆ begin_stmt()

static void TrxInInnoDB::begin_stmt ( trx_t trx)
inlinestatic

Start statement requested for transaction.

Parameters
[in,out]trxTransaction at the start of a SQL statement

◆ end_stmt()

static void TrxInInnoDB::end_stmt ( trx_t trx)
inlinestatic

Note an end statement for transaction.

Parameters
[in,out]trxTransaction at end of a SQL statement

◆ enter()

static void TrxInInnoDB::enter ( trx_t trx,
bool  disable 
)
inlinestaticprivate

Note that we have crossed into InnoDB code.

Parameters
[in]trxtransaction
[in]disabletrue if called from COMMIT/ROLLBACK method

◆ exit()

static void TrxInInnoDB::exit ( trx_t trx)
inlinestaticprivate

Note that we are exiting InnoDB code.

◆ is_aborted() [1/2]

bool TrxInInnoDB::is_aborted ( ) const
inline
Returns
true if the transaction has been marked for asynchronous rollback

◆ is_aborted() [2/2]

static bool TrxInInnoDB::is_aborted ( const trx_t trx)
inlinestatic
Returns
true if the transaction has been marked for asynchronous rollback

◆ is_async_rollback()

static bool TrxInInnoDB::is_async_rollback ( const trx_t trx)
inlinestatic
Returns
true if the rollback is being initiated by the thread that marked the transaction for asynchronous rollback

◆ is_forced_rollback()

static bool TrxInInnoDB::is_forced_rollback ( const trx_t trx)
inlinestaticprivate

◆ is_rollback_disabled()

bool TrxInInnoDB::is_rollback_disabled ( ) const
inline
Returns
true if the transaction can't be rolled back asynchronously

◆ is_started()

static bool TrxInInnoDB::is_started ( const trx_t trx)
inlinestaticprivate
Returns
true if transaction is started

◆ wait()

static void TrxInInnoDB::wait ( const trx_t trx)
inlinestaticprivate

Wait for the asynchronous rollback to complete, if it is in progress.

Member Data Documentation

◆ m_trx

trx_t* TrxInInnoDB::m_trx
private

Transaction instance crossing the handler boundary from the Server.


The documentation for this class was generated from the following file: