MySQL 8.4.3
Source Code Documentation
Ha_trx_info Class Reference

Either statement transaction or normal transaction - related thread-specific storage engine data. More...

#include <transaction_info.h>

Public Member Functions

void register_ha (Transaction_ctx::THD_TRANS *trans, handlerton *ht_arg)
 Register this storage engine in the given transaction context. More...
 
void reset ()
 Clear, prepare for reuse. More...
 
 Ha_trx_info ()
 
void set_trx_read_write ()
 
bool is_trx_read_write () const
 
bool is_started () const
 
void coalesce_trx_with (const Ha_trx_info *stmt_trx)
 Mark this transaction read-write if the argument is read-write. More...
 
void coalesce_trx_with (const Ha_trx_info &stmt_trx)
 
handlertonht () const
 

Private Types

enum  { TRX_READ_ONLY = 0 , TRX_READ_WRITE = 1 }
 

Private Attributes

Ha_trx_infom_next
 Auxiliary, used for ha_list management. More...
 
handlertonm_ht
 Although a given Ha_trx_info instance is currently always used for the same storage engine, 'ht' is not-NULL only when the corresponding storage is a part of a transaction. More...
 
uchar m_flags
 Transaction flags related to this engine. More...
 

Friends

class Ha_trx_info_list
 

Detailed Description

Either statement transaction or normal transaction - related thread-specific storage engine data.

If a storage engine participates in a statement/transaction, an instance of this class is present in thd->m_transaction.m_scope_info[STMT|SESSION].ha_list. The addition this list is made by trans_register_ha().

When it's time to commit or rollback, each element of ha_list is used to access storage engine's prepare()/commit()/rollback() methods, and also to evaluate if a full two phase commit is necessary.

See also
General description of transaction handling in handler.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
TRX_READ_ONLY 
TRX_READ_WRITE 

Constructor & Destructor Documentation

◆ Ha_trx_info()

Ha_trx_info::Ha_trx_info ( )
inline

Member Function Documentation

◆ coalesce_trx_with() [1/2]

void Ha_trx_info::coalesce_trx_with ( const Ha_trx_info stmt_trx)
inline

◆ coalesce_trx_with() [2/2]

void Ha_trx_info::coalesce_trx_with ( const Ha_trx_info stmt_trx)
inline

Mark this transaction read-write if the argument is read-write.

◆ ht()

handlerton * Ha_trx_info::ht ( ) const
inline

◆ is_started()

bool Ha_trx_info::is_started ( ) const
inline

◆ is_trx_read_write()

bool Ha_trx_info::is_trx_read_write ( ) const
inline

◆ register_ha()

void Ha_trx_info::register_ha ( Transaction_ctx::THD_TRANS trans,
handlerton ht_arg 
)
inline

Register this storage engine in the given transaction context.

◆ reset()

void Ha_trx_info::reset ( void  )
inline

Clear, prepare for reuse.

◆ set_trx_read_write()

void Ha_trx_info::set_trx_read_write ( )
inline

Friends And Related Function Documentation

◆ Ha_trx_info_list

friend class Ha_trx_info_list
friend

Member Data Documentation

◆ m_flags

uchar Ha_trx_info::m_flags
private

Transaction flags related to this engine.

Not-null only if this instance is a part of transaction. May assume a combination of enum values above.

◆ m_ht

handlerton* Ha_trx_info::m_ht
private

Although a given Ha_trx_info instance is currently always used for the same storage engine, 'ht' is not-NULL only when the corresponding storage is a part of a transaction.

◆ m_next

Ha_trx_info* Ha_trx_info::m_next
private

Auxiliary, used for ha_list management.


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