28#error "Don't include this C++ header file from a non-C++ file!"
35#include <unordered_map>
98 uint, std::unique_ptr<HASH_ROW_ENTRY, hash_slave_rows_free_entry>>::
224 uint, std::unique_ptr<HASH_ROW_ENTRY, hash_slave_rows_free_entry>>
274 const std::vector<unsigned int> &vector_dimensionality);
317 for (uint i = 0; i <
size(); i++)
327 for (ulong i = 0; i <
size; i++) {
353 switch (source_type) {
355 int real_type = source_metadata >> 8;
432 const uchar *master_data,
434 uint32 *field_size)
const;
474 TABLE **conv_table_var);
501 bool replica_has_gipk)
const;
560 const char *table_name_arg,
size_t table_name_length_arg,
562 :
Table_ref(db_name_arg, db_length_arg, table_name_arg,
563 table_name_length_arg, alias_arg, lock_type_arg) {}
620#define DBUG_PRINT_BITSET(N, FRM, BS) \
624 for (i = 0; i < std::min(uint{sizeof(buf) - 1}, (BS)->n_bits); i++) \
625 buf[i] = bitmap_is_set((BS), i) ? '1' : '0'; \
627 DBUG_PRINT((N), ((FRM), buf)); \
enum_calc_field_size_status
Definition: binary_log_funcs.h:60
Definition: rpl_utility.h:570
bool is_empty()
Definition: rpl_utility.cc:1313
int add(Log_event *ev)
Definition: rpl_utility.cc:1307
~Deferred_log_events()
Definition: rpl_utility.cc:1305
bool execute(Relay_log_info *rli)
Definition: rpl_utility.cc:1315
void rewind()
Definition: rpl_utility.cc:1329
Prealloced_array< Log_event *, 32 > m_array
Definition: rpl_utility.h:572
Deferred_log_events()
Definition: rpl_utility.cc:1302
Definition: rpl_utility.h:112
malloc_unordered_multimap< uint, std::unique_ptr< HASH_ROW_ENTRY, hash_slave_rows_free_entry > > m_hash
The hashtable itself.
Definition: rpl_utility.h:225
bool del(HASH_ROW_ENTRY *entry)
Deletes the entry pointed by entry.
Definition: rpl_utility.cc:1189
HASH_ROW_ENTRY * get(TABLE *table, MY_BITMAP *cols)
Gets the entry, from the hash table, that matches the data in table->record[0] and signaled using col...
Definition: rpl_utility.cc:1123
HASH_ROW_ENTRY * make_entry()
Allocates an empty entry to be added to the hash table.
Definition: rpl_utility.cc:1052
bool next(HASH_ROW_ENTRY **entry)
Gets the entry that stands next to the one pointed to by entry.
Definition: rpl_utility.cc:1148
bool deinit(void)
De-initializes the hash table.
Definition: rpl_utility.cc:1044
int size()
Returns the number of entries in the hash table.
Definition: rpl_utility.cc:1050
uint make_hash_key(TABLE *table, MY_BITMAP *cols)
Auxiliary and internal method used to create an hash key, based on the data in table->record[0] buffe...
Definition: rpl_utility.cc:1197
bool init(void)
Initializes the hash table.
Definition: rpl_utility.cc:1042
bool put(TABLE *table, MY_BITMAP *cols, HASH_ROW_ENTRY *entry)
Puts data into the hash table.
Definition: rpl_utility.cc:1102
bool is_empty(void)
Checks if the hash table is empty or not.
Definition: rpl_utility.cc:1036
This is the abstract base class for binary log events.
Definition: log_event.h:539
A typesafe replacement for DYNAMIC_ARRAY.
Definition: prealloced_array.h:71
Definition: rpl_rli.h:208
Sentry class for managing the need to create and dispose of a local THD instance.
Definition: rpl_utility.h:653
bool m_is_locally_initialized
Tells whether or not the active THD object was created in this object constructor.
Definition: rpl_utility.h:686
THD_instance_guard(THD *thd)
If the given THD object pointer is nullptr, a new instance will be initialized within the constructor...
Definition: rpl_utility.cc:1357
THD * m_target
The active THD object pointer.
Definition: rpl_utility.h:681
virtual ~THD_instance_guard()
If a new instance of THD was created in the constructor, it will be disposed here.
Definition: rpl_utility.cc:1370
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
std::unordered_multimap, but with my_malloc, so that you can track the memory used using PSI memory k...
Definition: map_helpers.h:198
A table definition from the master.
Definition: rpl_utility.h:251
int m_json_column_count
Definition: rpl_utility.h:544
ulong filtered_size(bool replica_has_gipk) const
Return the number of fields there is type data for minus the GIPK field if this field does not exist ...
Definition: rpl_utility.h:299
ulong m_size
Definition: rpl_utility.h:537
bool compatible_with(THD *thd, Relay_log_info *rli, TABLE *table, TABLE **conv_table_var)
Decide if the table definition is compatible with a table.
Definition: rpl_utility.cc:482
uint32 calc_field_size(uint col, const uchar *master_data) const
Definition: rpl_utility.cc:96
bool compute_source_table_gipk_info(THD &thd, TABLE *table)
Evaluates if the source table might contain a GIPK.
Definition: rpl_utility.cc:818
enum_field_types type(ulong index) const
Definition: rpl_utility.h:344
std::vector< unsignedint >::const_iterator get_vector_dimensionality_begin() const
Definition: rpl_utility.h:436
table_def()=default
No-op constructor.
bool * m_is_array
Definition: rpl_utility.h:545
uchar * m_memory
Definition: rpl_utility.h:543
int json_column_count() const
Return the number of JSON columns in this table.
Definition: rpl_utility.h:313
ulong size() const
Return the number of fields there is type data for.
Definition: rpl_utility.h:291
enum_calc_field_size_status calc_field_size_checked(uint col, const uchar *master_data, size_t available, uint32 *field_size) const
Definition: rpl_utility.cc:102
unsigned char * m_type
Definition: rpl_utility.h:538
uint m_field_metadata_size
Definition: rpl_utility.h:539
TABLE * create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *target_table, bool replica_has_gipk) const
Create a virtual in-memory temporary table structure.
Definition: rpl_utility.cc:672
std::vector< unsignedint >::const_iterator get_vector_dimensionality_end() const
Definition: rpl_utility.h:441
uint * m_field_metadata
Definition: rpl_utility.h:540
enum_field_types binlog_type(ulong index) const
Definition: rpl_utility.h:308
bool m_is_gipk_on_table
Definition: rpl_utility.h:547
bool m_is_gipk_set
Definition: rpl_utility.h:546
uint16 m_flags
Definition: rpl_utility.h:542
bool is_array(uint index) const
Returns whether or not the field at index is a typed array.
Definition: rpl_utility.h:400
static uint vector_column_count(const unsigned char *types, ulong size)
Return the number of VECTOR columns.
Definition: rpl_utility.h:325
bool is_gipk_present_on_source_table() const
Checks if the table contains a GIPK.
Definition: rpl_utility.cc:813
bool m_is_valid
Whether the serialized field metadata stream decoded within bounds.
Definition: rpl_utility.h:549
~table_def()
Definition: rpl_utility.cc:1008
bool maybe_null(uint index) const
Definition: rpl_utility.h:412
bool is_valid() const
Return whether the table definition metadata was decoded successfully.
Definition: rpl_utility.h:284
uchar * m_null_bits
Definition: rpl_utility.h:541
uint field_metadata(uint index) const
Definition: rpl_utility.h:389
std::vector< unsigned int > m_vector_dimensionality
Definition: rpl_utility.h:550
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:56
@ MYSQL_TYPE_SET
Definition: field_types.h:84
@ MYSQL_TYPE_NEWDATE
Internal to MySQL.
Definition: field_types.h:71
@ MYSQL_TYPE_VECTOR
Definition: field_types.h:78
@ MYSQL_TYPE_JSON
Definition: field_types.h:81
@ MYSQL_TYPE_STRING
Definition: field_types.h:90
@ MYSQL_TYPE_ENUM
Definition: field_types.h:83
@ MYSQL_TYPE_DATE
Definition: field_types.h:67
static int flags[50]
Definition: hp_test1.cc:40
Some integer typedefs for easier portability.
unsigned char uchar
Definition: my_inttypes.h:52
uint16_t uint16
Definition: my_inttypes.h:65
uint32_t uint32
Definition: my_inttypes.h:67
static int count
Definition: myisam_ftdump.cc:45
static bool replace
Definition: mysqlimport.cc:70
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
Container::const_iterator find(const Container &c, Value &&value)
Definition: generic.h:40
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
PSI_memory_key key_memory_HASH_ROW_ENTRY
Definition: psi_memory_key.cc:51
required uint64 version
Definition: replication_group_member_actions.proto:41
bool is_immediate_server_gipk_ready(THD &thd)
Checks if the immediate_server_version supports GIPKs or not.
Definition: rpl_utility.cc:1415
bool is_require_row_format_violation(const THD *thd)
This method shall evaluate if a command being executed goes against any of the restrictions of server...
Definition: rpl_utility.cc:1386
std::string replace_all_in_str(std::string from, std::string find, std::string replace)
Replaces every occurrence of the string find by the string replace, within the string from and return...
Definition: rpl_utility.cc:1338
std::tuple< bool, my_off_t, std::pair< uint, bool > > read_field_metadata(const uchar *buffer, uint metadata_size, enum_field_types binlog_type)
Decode field metadata from a char buffer (serialized form) into an int (packed form).
Definition: rpl_utility.cc:863
bool does_source_table_contain_gipk(Relay_log_info const *rli, TABLE *table)
Returns if the replicated table contains a GIPK or not.
Definition: rpl_utility.cc:1420
std::string decimal_numeric_version_to_string(uint32 version)
Returns a string representation for a given version.
Definition: rpl_utility.cc:1428
Definition: rpl_utility.h:107
HASH_ROW_POS * positions
Definition: rpl_utility.h:109
HASH_ROW_PREAMBLE * preamble
Definition: rpl_utility.h:108
Hash table used when applying row events on the slave and there is no index on the slave's table.
Definition: rpl_utility.h:63
const uchar * bi_start
Points at the position where the row starts in the event buffer (ie, area in memory before unpacking ...
Definition: rpl_utility.h:69
const uchar * bi_ends
Definition: rpl_utility.h:70
Internal structure that acts as a preamble for HASH_ROW_POS in memory structure.
Definition: rpl_utility.h:86
malloc_unordered_multimap< uint, std::unique_ptr< HASH_ROW_ENTRY, hash_slave_rows_free_entry > >::const_iterator search_state
The search state used to iterate over multiple entries for a given key.
Definition: rpl_utility.h:99
bool is_search_state_inited
whether this search_state is usable or not.
Definition: rpl_utility.h:104
uint hash_value
Definition: rpl_utility.h:91
HASH_ROW_PREAMBLE()=default
Definition: my_bitmap.h:43
Extend the normal Table_ref with a few new fields needed by the slave thread, but nowhere else.
Definition: rpl_utility.h:558
RPL_Table_ref(const char *db_name_arg, size_t db_length_arg, const char *table_name_arg, size_t table_name_length_arg, const char *alias_arg, enum thr_lock_type lock_type_arg)
Definition: rpl_utility.h:559
table_def m_tabledef
Definition: rpl_utility.h:566
bool m_tabledef_valid
Definition: rpl_utility.h:565
TABLE * m_conv_table
Definition: rpl_utility.h:567
Definition: completion_hash.h:35
Definition: rpl_utility.h:75
void operator()(HASH_ROW_ENTRY *entry) const
Utility methods for handling row based operations.
Definition: rpl_utility.cc:1024
thr_lock_type
Definition: thr_lock.h:51