24#ifndef TRANSACTION_INFO_INCLUDED
25#define TRANSACTION_INFO_INCLUDED
136 DBUG_PRINT(
"debug", (
"reset_unsafe_rollback_flags"));
140 DBUG_PRINT(
"debug", (
"mark_modified_non_trans_table"));
147 DBUG_PRINT(
"debug", (
"mark_created_temp_table"));
154 DBUG_PRINT(
"debug", (
"mark_dropped_temp_table"));
412 assert(
m_ht ==
nullptr);
413 assert(
m_next ==
nullptr);
704 operator bool()
const;
Implements a forward iterator for Ha_trx_info_list.
Definition: transaction_info.h:521
Ha_trx_info * m_current
Item this iterator is currently pointing to
Definition: transaction_info.h:561
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:523
Iterator(Ha_trx_info *parent)
Definition: transaction_info.cc:84
std::forward_iterator_tag iterator_category
Definition: transaction_info.h:526
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:563
Container to hold and allow iteration over a set of Ha_trx_info objects.
Definition: transaction_info.h:502
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:738
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:402
void coalesce_trx_with(const Ha_trx_info &stmt_trx)
Definition: transaction_info.h:460
handlerton * ht() const
Definition: transaction_info.h:470
bool is_started() const
Definition: transaction_info.h:450
handlerton * m_ht
Although a given Ha_trx_info instance is currently always used for the same storage engine,...
Definition: transaction_info.h:487
bool is_trx_read_write() const
Definition: transaction_info.h:445
Ha_trx_info * m_next
Auxiliary, used for ha_list management.
Definition: transaction_info.h:480
void reset()
Clear, prepare for reuse.
Definition: transaction_info.h:430
void set_trx_read_write()
Definition: transaction_info.h:440
Ha_trx_info()
Definition: transaction_info.h:438
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:456
void register_ha(Transaction_ctx::THD_TRANS *trans, handlerton *ht_arg)
Register this storage engine in the given transaction context.
Definition: transaction_info.h:409
uchar m_flags
Transaction flags related to this engine.
Definition: transaction_info.h:494
@ TRX_READ_WRITE
Definition: transaction_info.h:476
@ TRX_READ_ONLY
Definition: transaction_info.h:476
Savepoint for MDL context.
Definition: mdl.h:1316
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:34
Definition: transaction_info.h:53
void set_rw_ha_count(enum_trx_scope scope, int value)
Definition: transaction_info.h:347
void merge_unsafe_rollback_flags()
Definition: transaction_info.h:242
Rpl_transaction_write_set_ctx m_transaction_write_set_ctx
Definition: transaction_info.h:381
bool has_created_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:317
bool is_active(enum_trx_scope scope) const
Definition: transaction_info.h:236
void * allocate_memory(unsigned int size)
Definition: transaction_info.h:259
bool cannot_safely_rollback(enum_trx_scope scope) const
Definition: transaction_info.h:285
bool enabled
Definition: transaction_info.h:187
char * strmake(const char *str, size_t len)
Definition: transaction_info.h:265
struct Transaction_ctx::@182 m_flags
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:223
bool was_trans_begin_hook_invoked()
Definition: transaction_info.h:375
bool no_2pc(enum_trx_scope scope) const
Definition: transaction_info.h:339
void set_trans_begin_hook_invoked()
Definition: transaction_info.h:377
MEM_ROOT m_mem_root
Definition: transaction_info.h:174
SAVEPOINT * m_savepoints
Definition: transaction_info.h:57
int64 last_committed
Definition: transaction_info.h:209
bool real_commit
Definition: transaction_info.h:189
void reset_unsafe_rollback_flags(enum_trx_scope scope)
Definition: transaction_info.h:301
Transaction_ctx()
Definition: transaction_info.cc:43
void push_unsafe_rollback_warnings(THD *thd)
Definition: transaction_info.cc:56
XID_STATE * xid_state()
Definition: transaction_info.h:281
const Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx() const
Definition: transaction_info.h:371
bool run_hooks
Definition: transaction_info.h:191
bool commit_low
Definition: transaction_info.h:190
XID_STATE m_xid_state
Definition: transaction_info.h:172
void reset(enum_trx_scope scope)
Definition: transaction_info.h:329
int64 sequence_number
Definition: transaction_info.h:218
void init_mem_root_defaults(ulong trans_alloc_block_size, ulong)
Definition: transaction_info.h:253
const Rpl_transaction_ctx * get_rpl_transaction_ctx() const
Definition: transaction_info.h:363
void store_commit_parent(int64 last_arg)
Definition: transaction_info.h:220
int rw_ha_count(enum_trx_scope scope) const
Definition: transaction_info.h:343
void add_changed_table(const char *key, uint32 key_length)
bool trans_begin_hook_invoked
Definition: transaction_info.h:382
void set_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:293
const XID_STATE * xid_state() const
Definition: transaction_info.h:283
bool xid_written
Definition: transaction_info.h:188
void claim_memory_ownership(bool claim)
Definition: transaction_info.h:261
Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx()
Definition: transaction_info.h:367
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:289
void mark_modified_non_trans_table(enum_trx_scope scope)
Definition: transaction_info.h:305
void reset_scope(enum_trx_scope scope)
Definition: transaction_info.h:351
void free_memory()
Definition: transaction_info.h:263
void invalidate_changed_tables_in_cache(THD *thd)
void add_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:297
void cleanup()
Definition: transaction_info.h:225
void mark_created_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:313
void set_no_2pc(enum_trx_scope scope, bool value)
Definition: transaction_info.h:335
bool has_dropped_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:325
bool has_modified_non_trans_table(enum_trx_scope scope) const
Definition: transaction_info.h:309
bool ready_preempt
Definition: transaction_info.h:193
void mark_dropped_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:321
Rpl_transaction_ctx m_rpl_transaction_ctx
Definition: transaction_info.h:380
THD_TRANS m_scope_info[2]
Definition: transaction_info.h:170
void set_ha_trx_info(enum_trx_scope scope, Ha_trx_info *trx_info)
Definition: transaction_info.h:275
Rpl_transaction_ctx * get_rpl_transaction_ctx()
Definition: transaction_info.h:359
bool is_empty(enum_trx_scope scope) const
Definition: transaction_info.h:331
enum_trx_scope
Definition: transaction_info.h:55
@ SESSION
Definition: transaction_info.h:55
@ STMT
Definition: transaction_info.h:55
MEM_ROOT * transaction_memroot()
Definition: transaction_info.h:257
void cleanup()
Definition: xa.h:365
char * strmake_root(MEM_ROOT *root, const char *str, size_t len)
Definition: my_alloc.cc:286
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:148
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
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:222
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:171
void ClearForReuse()
Similar to Clear(), but anticipates that the block will be reused for further allocations.
Definition: my_alloc.cc:189
void * Alloc(size_t length)
Allocate memory.
Definition: my_alloc.h:145
Definition: transaction_info.h:44
size_t length
Definition: transaction_info.h:47
char * name
Definition: transaction_info.h:46
Ha_trx_info * ha_list
Definition: transaction_info.h:48
SAVEPOINT * prev
Definition: transaction_info.h:45
MDL_savepoint mdl_savepoint
State of metadata locks before this savepoint was set.
Definition: transaction_info.h:50
Definition: transaction_info.h:62
void add_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:131
void mark_modified_non_trans_table()
Definition: transaction_info.h:139
bool has_modified_non_trans_table() const
Definition: transaction_info.h:143
void mark_dropped_temp_table()
Definition: transaction_info.h:153
bool m_no_2pc
Definition: transaction_info.h:64
unsigned int get_unsafe_rollback_flags() const
Definition: transaction_info.h:124
static unsigned int const DROPPED_TEMP_TABLE
Definition: transaction_info.h:120
void reset_unsafe_rollback_flags()
Definition: transaction_info.h:135
bool is_empty() const
Definition: transaction_info.h:166
bool cannot_safely_rollback() const
Definition: transaction_info.h:123
void mark_created_temp_table()
Definition: transaction_info.h:146
void set_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:127
Ha_trx_info * m_ha_list
Definition: transaction_info.h:67
int m_rw_ha_count
Definition: transaction_info.h:65
bool has_dropped_temp_table() const
Definition: transaction_info.h:157
static unsigned int const MODIFIED_NON_TRANS_TABLE
Definition: transaction_info.h:118
static unsigned int const CREATED_TEMP_TABLE
Definition: transaction_info.h:119
unsigned int m_unsafe_rollback_flags
Definition: transaction_info.h:113
void reset()
Definition: transaction_info.h:161
bool has_created_temp_table() const
Definition: transaction_info.h:150
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2622