24#ifndef TRANSACTION_INFO_INCLUDED
25#define TRANSACTION_INFO_INCLUDED
138 DBUG_PRINT(
"debug", (
"reset_unsafe_rollback_flags"));
142 DBUG_PRINT(
"debug", (
"mark_modified_non_trans_table"));
149 DBUG_PRINT(
"debug", (
"mark_created_temp_table"));
156 DBUG_PRINT(
"debug", (
"mark_dropped_temp_table"));
424 assert(
m_ht ==
nullptr);
425 assert(
m_next ==
nullptr);
716 operator bool()
const;
Definition: engine_combination_tracker.h:27
void clear_known_engine()
This method clear the registered engine in the variable m_known_engine.
Definition: engine_combination_tracker.cc:56
void set_warning_already_emitted(bool value)
This method sets the value of is_warning_already_emitted.
Definition: engine_combination_tracker.cc:64
Implements a forward iterator for Ha_trx_info_list.
Definition: transaction_info.h:533
Ha_trx_info * m_current
Item this iterator is currently pointing to
Definition: transaction_info.h:573
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:535
Iterator(Ha_trx_info *parent)
Definition: transaction_info.cc:84
std::forward_iterator_tag iterator_category
Definition: transaction_info.h:538
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:575
Container to hold and allow iteration over a set of Ha_trx_info objects.
Definition: transaction_info.h:514
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:750
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:414
void coalesce_trx_with(const Ha_trx_info &stmt_trx)
Definition: transaction_info.h:472
handlerton * ht() const
Definition: transaction_info.h:482
@ TRX_READ_WRITE
Definition: transaction_info.h:488
@ TRX_READ_ONLY
Definition: transaction_info.h:488
bool is_started() const
Definition: transaction_info.h:462
handlerton * m_ht
Although a given Ha_trx_info instance is currently always used for the same storage engine,...
Definition: transaction_info.h:499
bool is_trx_read_write() const
Definition: transaction_info.h:457
Ha_trx_info * m_next
Auxiliary, used for ha_list management.
Definition: transaction_info.h:492
void reset()
Clear, prepare for reuse.
Definition: transaction_info.h:442
void set_trx_read_write()
Definition: transaction_info.h:452
Ha_trx_info()
Definition: transaction_info.h:450
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:468
void register_ha(Transaction_ctx::THD_TRANS *trans, handlerton *ht_arg)
Register this storage engine in the given transaction context.
Definition: transaction_info.h:421
uchar m_flags
Transaction flags related to this engine.
Definition: transaction_info.h:506
Savepoint for MDL context.
Definition: mdl.h:1318
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:55
void set_rw_ha_count(enum_trx_scope scope, int value)
Definition: transaction_info.h:356
void merge_unsafe_rollback_flags()
Definition: transaction_info.h:251
Rpl_transaction_write_set_ctx m_transaction_write_set_ctx
Definition: transaction_info.h:390
bool has_created_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:326
bool is_active(enum_trx_scope scope) const
Definition: transaction_info.h:245
void * allocate_memory(unsigned int size)
Definition: transaction_info.h:268
bool cannot_safely_rollback(enum_trx_scope scope) const
Definition: transaction_info.h:294
bool enabled
Definition: transaction_info.h:189
char * strmake(const char *str, size_t len)
Definition: transaction_info.h:274
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:225
bool was_trans_begin_hook_invoked()
Definition: transaction_info.h:384
bool no_2pc(enum_trx_scope scope) const
Definition: transaction_info.h:348
void set_trans_begin_hook_invoked()
Definition: transaction_info.h:386
MEM_ROOT m_mem_root
Definition: transaction_info.h:176
SAVEPOINT * m_savepoints
Definition: transaction_info.h:59
int64 last_committed
Definition: transaction_info.h:211
bool real_commit
Definition: transaction_info.h:191
void reset_unsafe_rollback_flags(enum_trx_scope scope)
Definition: transaction_info.h:310
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:290
const Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx() const
Definition: transaction_info.h:380
bool run_hooks
Definition: transaction_info.h:193
bool commit_low
Definition: transaction_info.h:192
XID_STATE m_xid_state
Definition: transaction_info.h:174
void reset(enum_trx_scope scope)
Definition: transaction_info.h:338
int64 sequence_number
Definition: transaction_info.h:220
void init_mem_root_defaults(ulong trans_alloc_block_size, ulong)
Definition: transaction_info.h:262
const Rpl_transaction_ctx * get_rpl_transaction_ctx() const
Definition: transaction_info.h:372
void store_commit_parent(int64 last_arg)
Definition: transaction_info.h:222
int rw_ha_count(enum_trx_scope scope) const
Definition: transaction_info.h:352
void add_changed_table(const char *key, uint32 key_length)
bool trans_begin_hook_invoked
Definition: transaction_info.h:391
void set_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:302
const XID_STATE * xid_state() const
Definition: transaction_info.h:292
bool xid_written
Definition: transaction_info.h:190
void claim_memory_ownership(bool claim)
Definition: transaction_info.h:270
Rpl_transaction_write_set_ctx * get_transaction_write_set_ctx()
Definition: transaction_info.h:376
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:298
void mark_modified_non_trans_table(enum_trx_scope scope)
Definition: transaction_info.h:314
void reset_scope(enum_trx_scope scope)
Definition: transaction_info.h:360
void free_memory()
Definition: transaction_info.h:272
void invalidate_changed_tables_in_cache(THD *thd)
Engine_combination_tracker tracker
Definition: transaction_info.h:394
void add_unsafe_rollback_flags(enum_trx_scope scope, unsigned int flags)
Definition: transaction_info.h:306
void cleanup()
Definition: transaction_info.h:227
void mark_created_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:322
void set_no_2pc(enum_trx_scope scope, bool value)
Definition: transaction_info.h:344
bool has_dropped_temp_table(enum_trx_scope scope) const
Definition: transaction_info.h:334
bool has_modified_non_trans_table(enum_trx_scope scope) const
Definition: transaction_info.h:318
bool ready_preempt
Definition: transaction_info.h:195
void mark_dropped_temp_table(enum_trx_scope scope)
Definition: transaction_info.h:330
Rpl_transaction_ctx m_rpl_transaction_ctx
Definition: transaction_info.h:389
THD_TRANS m_scope_info[2]
Definition: transaction_info.h:172
void set_ha_trx_info(enum_trx_scope scope, Ha_trx_info *trx_info)
Definition: transaction_info.h:284
Rpl_transaction_ctx * get_rpl_transaction_ctx()
Definition: transaction_info.h:368
bool is_empty(enum_trx_scope scope) const
Definition: transaction_info.h:340
enum_trx_scope
Definition: transaction_info.h:57
@ SESSION
Definition: transaction_info.h:57
@ STMT
Definition: transaction_info.h:57
MEM_ROOT * transaction_memroot()
Definition: transaction_info.h:266
struct Transaction_ctx::@192 m_flags
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:159
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1105
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:46
size_t length
Definition: transaction_info.h:49
char * name
Definition: transaction_info.h:48
Ha_trx_info * ha_list
Definition: transaction_info.h:50
SAVEPOINT * prev
Definition: transaction_info.h:47
MDL_savepoint mdl_savepoint
State of metadata locks before this savepoint was set.
Definition: transaction_info.h:52
Definition: transaction_info.h:64
void add_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:133
void mark_modified_non_trans_table()
Definition: transaction_info.h:141
bool has_modified_non_trans_table() const
Definition: transaction_info.h:145
void mark_dropped_temp_table()
Definition: transaction_info.h:155
bool m_no_2pc
Definition: transaction_info.h:66
unsigned int get_unsafe_rollback_flags() const
Definition: transaction_info.h:126
static unsigned int const DROPPED_TEMP_TABLE
Definition: transaction_info.h:122
void reset_unsafe_rollback_flags()
Definition: transaction_info.h:137
bool is_empty() const
Definition: transaction_info.h:168
bool cannot_safely_rollback() const
Definition: transaction_info.h:125
void mark_created_temp_table()
Definition: transaction_info.h:148
void set_unsafe_rollback_flags(unsigned int flags)
Definition: transaction_info.h:129
Ha_trx_info * m_ha_list
Definition: transaction_info.h:69
int m_rw_ha_count
Definition: transaction_info.h:67
bool has_dropped_temp_table() const
Definition: transaction_info.h:159
static unsigned int const MODIFIED_NON_TRANS_TABLE
Definition: transaction_info.h:120
static unsigned int const CREATED_TEMP_TABLE
Definition: transaction_info.h:121
unsigned int m_unsafe_rollback_flags
Definition: transaction_info.h:115
void reset()
Definition: transaction_info.h:163
bool has_created_temp_table() const
Definition: transaction_info.h:152
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2740