MySQL 8.0.40
Source Code Documentation
trx_guid_t Struct Reference

Used to identify trx uniquely over time. More...

#include <trx0types.h>

Public Member Functions

 trx_guid_t ()=default
 Initializes trx_guid_t object to a value which doesn't match any real transaction. More...
 
 trx_guid_t (const trx_t &trx)
 Initializes trx_guid_t with data uniquely identifying the transaction represented by trx_t object. More...
 
bool operator== (const trx_guid_t &rhs) const
 Checks if two guids represent the same transaction: they refer to the same trx_t struct and it was not reused meanwhile. More...
 
 operator bool () const
 Checks if the instance is non-empty, i.e. More...
 

Public Attributes

uint64_t m_immutable_id {}
 The immutable id of trx_t object - if you have a pointer to trx_t then we guarantee that immutable id of it will not change over time. More...
 
uint64_t m_version {}
 As trx_t objects and thus immutable ids can be reused we need also trx's version, which is incremented each time trx_t object gets reused. More...
 

Detailed Description

Used to identify trx uniquely over time.

Constructor & Destructor Documentation

◆ trx_guid_t() [1/2]

trx_guid_t::trx_guid_t ( )
default

Initializes trx_guid_t object to a value which doesn't match any real transaction.

◆ trx_guid_t() [2/2]

trx_guid_t::trx_guid_t ( const trx_t trx)

Initializes trx_guid_t with data uniquely identifying the transaction represented by trx_t object.

Parameters
[in]trxthe object representing the transaction

Member Function Documentation

◆ operator bool()

trx_guid_t::operator bool ( ) const
inline

Checks if the instance is non-empty, i.e.

was not default-constructed, but rather initialized to correspond to a real trx_t.

Returns
true iff this guid was initialized to match a real transaction

◆ operator==()

bool trx_guid_t::operator== ( const trx_guid_t rhs) const
inline

Checks if two guids represent the same transaction: they refer to the same trx_t struct and it was not reused meanwhile.

Parameters
[in]rhsanother guid to compare against
Returns
true iff the two guids are equal and thus represent same transaction

Member Data Documentation

◆ m_immutable_id

uint64_t trx_guid_t::m_immutable_id {}

The immutable id of trx_t object - if you have a pointer to trx_t then we guarantee that immutable id of it will not change over time.

Also there are never two trx_t objects at the same time with same immutable id. However it may happen that two different transactions that do not occur at the same time reuse the same trx_t and thus have same immutable id. Use m_version to detect this situation.

◆ m_version

uint64_t trx_guid_t::m_version {}

As trx_t objects and thus immutable ids can be reused we need also trx's version, which is incremented each time trx_t object gets reused.


The documentation for this struct was generated from the following files: