#include <sys/types.h>
#include <algorithm>
#include <string>
#include <unordered_map>
#include "field_types.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_macros.h"
#include "sql/psi_memory_key.h"
#include <memory>
#include "map_helpers.h"
#include "prealloced_array.h"
#include "sql/table.h"
Go to the source code of this file.
◆ DBUG_PRINT_BITSET
#define DBUG_PRINT_BITSET |
( |
|
N, |
|
|
|
FRM, |
|
|
|
BS |
|
) |
| |
Value: do { \
uint i; \
for (i = 0; i < std::min(
uint{
sizeof(
buf) - 1}, (BS)->n_bits); i++) \
buf[i] = '\0'; \
DBUG_PRINT((
N), ((FRM),
buf)); \
} while (0)
static bool bitmap_is_set(const MY_BITMAP *map, uint bit)
Definition: my_bitmap.h:95
std::atomic< Type > N
Definition: ut0counter.h:225
Definition: buf0block_hint.cc:30
unsigned int uint
Definition: uca9-dump.cc:75
◆ decimal_numeric_version_to_string()
std::string decimal_numeric_version_to_string |
( |
uint32 |
version | ) |
|
Returns a string representation for a given version.
- Parameters
-
version | a version represented using a integer |
- Returns
- a string for the given version or "unknown" if version is undefined or unknown.
◆ does_source_table_contain_gipk()
Returns if the replicated table contains a GIPK or not.
- Note
- for servers of older versions that do not fully support GIPK, this method returns a guess based on available information replication has.
- Parameters
-
rli | The relay log object associated to the channel |
table | The table to check for the GIPK |
- Returns
- true if we believe the table has a GIPK, false otherwise.
◆ is_immediate_server_gipk_ready()
bool is_immediate_server_gipk_ready |
( |
THD & |
thd | ) |
|
Checks if the immediate_server_version supports GIPKs or not.
- Parameters
-
thd | The THD context to check the version |
- Returns
- true if the source server supports GIPK, false otherwise
◆ is_require_row_format_violation()
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 variable session.require_row_format.
- Parameters
-
thd | The thread associated to the command |
- Returns
- true if it violates any restrictions false otherwise
◆ read_field_metadata()
Decode field metadata from a char buffer (serialized form) into an int (packed form).
- Note
- On little-endian platforms (e.g Intel) this function effectively inverts order of bytes compared to what Field::save_field_metadata() writes. E.g for MYSQL_TYPE_NEWDECIMAL save_field_metadata writes precision into the first byte and decimals into the second, this function puts precision into the second byte and decimals into the first. This layout is expected by replication code that reads metadata in the uint form. Due to this design feature show_sql_type() can't correctly print immediate output of save_field_metadata(), this function have to be used as translator.
- Parameters
-
buffer | Field metadata, in the character stream form produced by save_field_metadata. |
binlog_type | The type of the field, in the form returned by Field::binlog_type and stored in Table_map_log_event. |
- Return values
-
pair | where:
- the first component is the length of the metadata within 'buffer', i.e., how much the buffer pointer should move forward in order to skip it.
- the second component is pair containing:
- the metadata, encoded as an 'uint', in the form required by e.g. show_sql_type.
- bool indicating whether the field is array (true) or a scalar (false)
|
◆ rename_fields_use_old_replica_source_terms()
This function shall blindly replace some deprecated terms used in the field names with more recent ones.
This function must be removed once the related syntax (SHOW SLAVE STATUS and friends) is removed.
- Parameters
-
thd | the thread context. |
field_list | the list of fields that will have their name checked and altered if needed. |
◆ replace_all_in_str()
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 the resulting string.
The original string from
remains untouched.
- Parameters
-
from | the string to search within. |
find | the string to search for. |
replace | the string to replace every occurrence of from |
- Returns
- a new string, holding the result of the search and replace operation.