24#ifndef TRANSACTION_INFO_INCLUDED
25#define TRANSACTION_INFO_INCLUDED
137 DBUG_PRINT(
"debug", (
"reset_unsafe_rollback_flags"));
141 DBUG_PRINT(
"debug", (
"mark_modified_non_trans_table"));
148 DBUG_PRINT(
"debug", (
"mark_created_temp_table"));
155 DBUG_PRINT(
"debug", (
"mark_dropped_temp_table"));
413 assert(
m_ht ==
nullptr);
414 assert(
m_next ==
nullptr);
705 operator bool()
const;
Implements a forward iterator for Ha_trx_info_list.
Definition: transaction_info.h:522
Ha_trx_info * m_current
Item this iterator is currently pointing to
Definition: transaction_info.h:562
virtual ~Iterator()=default
Iterator & set_next()
Definition: transaction_info.cc:146
reference operator*() const
Definition: transaction_info.cc:106
Iterator & operator=(const Iterator &rhs)
Definition: transaction_info.cc:92
std::ptrdiff_t difference_type
Definition: transaction_info.h:524
Iterator(Ha_trx_info *parent)
Definition: transaction_info.cc:84
std::forward_iterator_tag iterator_category
Definition: transaction_info.h:527
pointer operator->() const
Definition: transaction_info.cc:117
bool operator==(Iterator const &rhs) const
Definition: transaction_info.cc:122
Iterator & operator++()
Definition: transaction_info.cc:99
bool operator!=(Iterator const &rhs) const
Definition: transaction_info.cc:134
Ha_trx_info * m_next
Next item in the list
Definition: transaction_info.h:564
Container to hold and allow iteration over a set of Ha_trx_info objects.
Definition: transaction_info.h:503
Ha_trx_info_list & operator=(Ha_trx_info_list const &rhs)
Copy operator.
Definition: transaction_info.cc:161
Iterator end()
Retrieves an iterator pointing to null.
Definition: transaction_info.cc:222
Ha_trx_info * operator->()
Retrieves the pointer to the undelying head of the list.
Definition: transaction_info.cc:178
bool operator==(Ha_trx_info_list const &rhs) const
Equality operator that compares with another instance of this class.
Definition: transaction_info.cc:184
virtual ~Ha_trx_info_list()=default
Ha_trx_info & operator*()
Retrieves the reference to the undelying head of the list.
Definition: transaction_info.cc:172
Ha_trx_info * m_underlying
The head of the list.
Definition: transaction_info.h:739
Ha_trx_info * head()
Retrieves the pointer to the underlying list head.
Definition: transaction_info.cc:212
bool operator!=(Ha_trx_info_list const &rhs) const
Inequality operator that compares with another instance of this class.
Definition: transaction_info.cc:196
Ha_trx_info_list()=default
Default constructor.
Iterator begin()
Retrieves an iterator pointing to the underlying list head.
Definition: transaction_info.cc:214
Either statement transaction or normal transaction - related thread-specific storage engine data.
Definition: transaction_info.h:403
void coalesce_trx_with(const Ha_trx_info &stmt_trx)
Definition: transaction_info.h:461
handlerton * ht() const
Definition: transaction_info.h:471
@ TRX_READ_WRITE
Definition: transaction_info.h:477
@ TRX_READ_ONLY
Definition: transaction_info.h:477
bool is_started() const
Definition: transaction_info.h:451
handlerton * m_ht
Although a given Ha_trx_info instance is currently always used for the same storage engine,...
Definition: transaction_info.h:488
bool is_trx_read_write() const
Definition: transaction_info.h:446
Ha_trx_info * m_next
Auxiliary, used for ha_list management.
Definition: transaction_info.h:481
void reset()
Clear, prepare for reuse.
Definition: transaction_info.h:431
void set_trx_read_write()
Definition: transaction_info.h:441
Ha_trx_info()
Definition: transaction_info.h:439
void coalesce_trx_with(const Ha_trx_info *stmt_trx)
Mark this transaction read-write if the argument is read-write.
Definition: transaction_info.h:457
void register_ha(Transaction_ctx::THD_TRANS *trans, handlerton *ht_arg)
Register this storage engine in the given transaction context.
Definition: transaction_info.h:410
uchar m_flags
Transaction flags related to this engine.
Definition: transaction_info.h:495
Savepoint for MDL context.
Definition: mdl.h:1317
Server side support to provide a service to plugins to report if a given transaction should continue ...
Definition: rpl_transaction_ctx.h:36
void cleanup()
Reset transaction context to default values.
Definition: rpl_transaction_ctx.cc:42
Thread class responsible for the collection of write sets associated to a transaction.
Definition: rpl_transaction_write_set_ctx.h:101
void reset_state()
Reset the object so it can be used for a new transaction.
Definition: rpl_transaction_write_set_ctx.cc:103
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: transaction_info.h:54
void set_rw_ha_count(enum_trx_scope scope, int value)
Definition: transaction_info.h:348
void merge_unsafe_rollback_flags()
Definition: transaction_info.h:243
Rpl_transaction_write_set_ctx m_transaction_write_set_ctx
Definition: transaction_info.h:382
bool has_created_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:318
bool is_active(enum_trx_scope scope) const
Definition: transaction_info.h:237
void * allocate_memory(unsigned int size)
Definition: transaction_info.h:260
bool cannot_safely_rollback(enum_trx_scope scope) const
Definition: transaction_info.h:286
bool enabled
Definition: transaction_info.h:188
char * strmake(const char *str, size_t len)
Definition: transaction_info.h:266
void register_ha(enum_trx_scope scope, Ha_trx_info *ha_info, handlerton *ht)
Definition: transaction_info.cc:75
virtual ~Transaction_ctx()
Definition: transaction_info.h:224
bool was_trans_begin_hook_invoked()
Definition: transaction_info.h:376
bool no_2pc(enum_trx_scope scope) const
Definition: transaction_info.h:340
void set_trans_begin_hook_invoked()
Definition: transaction_info.h:378
MEM_ROOT m_mem_root
Definition: transaction_info.h:175
SAVEPOINT * m_savepoints
Definition: transaction_info.h:58
int64 last_committed
Definition: transaction_info.h:210
bool real_commit
Definition: transaction_info.h:190
void reset_unsafe_rollback_flags(enum_trx_scope scope)
Definition: transaction_info.h:302
Transaction_ctx()
Definition: transaction_info.cc:43
void push_unsafe_rollback_warnings(THD *thd)
Definition: transaction_info.cc:56
struct Transaction_ctx::@190 m_flags
XID_STATE * xid_state()
Definition: transaction_info.h:282
const Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx() const
Definition: transaction_info.h:372
bool run_hooks
Definition: transaction_info.h:192
bool commit_low
Definition: transaction_info.h:191
XID_STATE m_xid_state
Definition: transaction_info.h:173
void reset(enum_trx_scope scope)
Definition: transaction_info.h:330
int64 sequence_number
Definition: transaction_info.h:219
void init_mem_root_defaults(ulong trans_alloc_block_size, ulong)
Definition: transaction_info.h:254
const Rpl_transaction_ctx * get_rpl_transaction_ctx() const
Definition: transaction_info.h:364
void store_commit_parent(int64 last_arg)
Definition: transaction_info.h:221
int rw_ha_count(enum_trx_scope scope) const
Definition: transaction_info.h:344
void add_changed_table(const char *key, uint32 key_length)
bool trans_begin_hook_invoked
Definition: transaction_info.h:383
void set_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:294
const XID_STATE * xid_state() const
Definition: transaction_info.h:284
bool xid_written
Definition: transaction_info.h:189
void claim_memory_ownership(bool claim)
Definition: transaction_info.h:262
Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx()
Definition: transaction_info.h:368
Ha_trx_info_list ha_trx_info(enum_trx_scope scope)
Definition: transaction_info.cc:80
unsigned int get_unsafe_rollback_flags(enum_trx_scope scope) const
Definition: transaction_info.h:290
void mark_modified_non_trans_table(enum_trx_scope scope)
Definition: transaction_info.h:306
void reset_scope(enum_trx_scope scope)
Definition: transaction_info.h:352
void free_memory()
Definition: transaction_info.h:264
void invalidate_changed_tables_in_cache(THD *thd)
void add_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:298
void cleanup()
Definition: transaction_info.h:226
void mark_created_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:314
void set_no_2pc(enum_trx_scope scope, bool value)
Definition: transaction_info.h:336
bool has_dropped_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:326
bool has_modified_non_trans_table(enum_trx_scope scope) const
Definition: transaction_info.h:310
bool ready_preempt
Definition: transaction_info.h:194
void mark_dropped_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:322
Rpl_transaction_ctx m_rpl_transaction_ctx
Definition: transaction_info.h:381
THD_TRANS m_scope_info[2]
Definition: transaction_info.h:171
void set_ha_trx_info(enum_trx_scope scope, Ha_trx_info *trx_info)
Definition: transaction_info.h:276
Rpl_transaction_ctx * get_rpl_transaction_ctx()
Definition: transaction_info.h:360
bool is_empty(enum_trx_scope scope) const
Definition: transaction_info.h:332
enum_trx_scope
Definition: transaction_info.h:56
@ SESSION
Definition: transaction_info.h:56
@ STMT
Definition: transaction_info.h:56
MEM_ROOT * transaction_memroot()
Definition: transaction_info.h:258
void cleanup()
Definition: xa.h:365
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:287
static int flags[50]
Definition: hp_test1.cc:40
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
#define DBUG_TRACE
Definition: my_dbug.h:146
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:52
int64_t int64
Definition: my_inttypes.h:68
uint32_t uint32
Definition: my_inttypes.h:67
Common header for many mysys elements.
static HashTable ht
Definition: mysql.cc:161
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
size_t size(const char *const c)
Definition: base64.h:46
required string key
Definition: replication_asynchronous_connection_failover.proto:60
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
void Claim(bool claim)
Claim all the allocated memory for the current thread in the performance schema.
Definition: my_alloc.cc:223
void set_block_size(size_t block_size)
Set the desired size of the next block to be allocated.
Definition: my_alloc.h:292
void Clear()
Deallocate all the RAM used.
Definition: my_alloc.cc:172
void ClearForReuse()
Similar to Clear(), but anticipates that the block will be reused for further allocations.
Definition: my_alloc.cc:190
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: transaction_info.h:45
size_t length
Definition: transaction_info.h:48
char * name
Definition: transaction_info.h:47
Ha_trx_info * ha_list
Definition: transaction_info.h:49
SAVEPOINT * prev
Definition: transaction_info.h:46
MDL_savepoint mdl_savepoint
State of metadata locks before this savepoint was set.
Definition: transaction_info.h:51
Definition: transaction_info.h:63
void add_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:132
void mark_modified_non_trans_table()
Definition: transaction_info.h:140
bool has_modified_non_trans_table() const
Definition: transaction_info.h:144
void mark_dropped_temp_table()
Definition: transaction_info.h:154
bool m_no_2pc
Definition: transaction_info.h:65
unsigned int get_unsafe_rollback_flags() const
Definition: transaction_info.h:125
static unsigned int const DROPPED_TEMP_TABLE
Definition: transaction_info.h:121
void reset_unsafe_rollback_flags()
Definition: transaction_info.h:136
bool is_empty() const
Definition: transaction_info.h:167
bool cannot_safely_rollback() const
Definition: transaction_info.h:124
void mark_created_temp_table()
Definition: transaction_info.h:147
void set_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:128
Ha_trx_info * m_ha_list
Definition: transaction_info.h:68
int m_rw_ha_count
Definition: transaction_info.h:66
bool has_dropped_temp_table() const
Definition: transaction_info.h:158
static unsigned int const MODIFIED_NON_TRANS_TABLE
Definition: transaction_info.h:119
static unsigned int const CREATED_TEMP_TABLE
Definition: transaction_info.h:120
unsigned int m_unsafe_rollback_flags
Definition: transaction_info.h:114
void reset()
Definition: transaction_info.h:162
bool has_created_temp_table() const
Definition: transaction_info.h:151
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2734