![]() |
MySQL 8.4.7
Source Code Documentation
|
This struct represents a specification of a GTID for a statement to be executed: either "AUTOMATIC", "AUTOMATIC:<tag>", "ANONYMOUS" or "TSID:GNO". More...
#include <rpl_gtid.h>
Public Types | |
| using | Tsid = mysql::gtid::Tsid |
| using | Tag = mysql::gtid::Tag |
| using | Tag_plain = mysql::gtid::Tag_plain |
Public Member Functions | |
| std::size_t | automatic_to_string (char *buf) const |
| Prints automatic tag specification to the given buffer. More... | |
| void | set (rpl_sidno sidno, rpl_gno gno) |
| Set the type to ASSIGNED_GTID and SIDNO, GNO to the given values. More... | |
| bool | is_automatic () const |
| Helper function indicating whether this is to-be-generated GTID. More... | |
| bool | is_undefined () const |
| Helper function indicating whether this is an undefined GTID. More... | |
| bool | is_assigned () const |
| Helper function indicating whether this is an assigned GTID. More... | |
| Tag | generate_tag () const |
| Returns tag object generated from internal tag data. More... | |
| bool | is_automatic_tagged () const |
| Helper function indicating whether this is to-be-generated GTID with a tag assigned. More... | |
| void | set (const Gtid >id_param) |
| Set the type to ASSIGNED_GTID and TSID, GNO to the given Gtid. More... | |
| void | set_automatic () |
| Set the type to AUTOMATIC_GTID. More... | |
| void | set (const Gtid_specification &other) |
| Copy spec from other. More... | |
| void | set_anonymous () |
| Set the type to ANONYMOUS_GTID. More... | |
| void | set_not_yet_determined () |
| Set the type to NOT_YET_DETERMINED_GTID. More... | |
| void | set_undefined () |
| Set to undefined. Must only be called if the type is ASSIGNED_GTID. More... | |
| bool | equals (const Gtid_specification &other) const |
| Return true if this Gtid_specification is equal to 'other'. More... | |
| bool | equals (const Gtid &other_gtid) const |
| Return true if this Gtid_specification is a ASSIGNED_GTID with the same TSID, GNO as 'other_gtid'. More... | |
| mysql::utils::Return_status | parse (Tsid_map *tsid_map, const char *text) |
| Parses the given string and stores in this Gtid_specification. More... | |
| int | to_string (const Tsid_map *tsid_map, char *buf, bool need_lock=false) const |
| Writes this Gtid_specification to the given string buffer. More... | |
| int | to_string (const Tsid &tsid, char *buf) const |
| Writes this Gtid_specification to the given string buffer. More... | |
| void | print () const |
| Debug only: print this Gtid_specification to stdout. More... | |
| void | dbug_print (const char *text="", bool need_lock=false) const |
| Print this Gtid_specification to the trace file if debug is enabled; no-op otherwise. More... | |
Static Public Member Functions | |
| static bool | is_automatic (const enum_gtid_type &type) |
| Helper function indicating whether this is to-be-generated GTID. More... | |
| static bool | is_valid (const char *text) |
| Returns true if the given string is a valid Gtid_specification. More... | |
| static bool | is_tagged (const char *text) |
| Returns true if the given string is a tagged Gtid_specification. More... | |
Public Attributes | |
| enum_gtid_type | type |
| The type of this GTID. More... | |
| Gtid | gtid |
| The GTID: { SIDNO, GNO } if type == GTID; { 0, 0 } if type == AUTOMATIC or ANONYMOUS. More... | |
| Tag_plain | automatic_tag |
| Tag defined by the user while specifying GTID_NEXT="AUTOMATIC:TAG". More... | |
Static Public Attributes | |
| static constexpr auto | str_automatic = "AUTOMATIC" |
| static constexpr auto | str_automatic_tagged = "AUTOMATIC:" |
| static constexpr auto | str_automatic_sep = ":" |
| static constexpr auto | str_pre_generated = "PRE_GENERATE_GTID" |
| static constexpr auto | str_not_yet_determined = "NOT_YET_DETERMINED" |
| static constexpr auto | str_anonymous = "ANONYMOUS" |
| static const int | MAX_TEXT_LENGTH = Gtid::MAX_TEXT_LENGTH |
This struct represents a specification of a GTID for a statement to be executed: either "AUTOMATIC", "AUTOMATIC:<tag>", "ANONYMOUS" or "TSID:GNO".
This is a POD. It has to be a POD because it is used in THD::variables.
| std::size_t Gtid_specification::automatic_to_string | ( | char * | buf | ) | const |
Prints automatic tag specification to the given buffer.
| [in,out] | buf | Buffer to write to, must be allocated |
|
inline |
Print this Gtid_specification to the trace file if debug is enabled; no-op otherwise.
|
inline |
Return true if this Gtid_specification is a ASSIGNED_GTID with the same TSID, GNO as 'other_gtid'.
|
inline |
Return true if this Gtid_specification is equal to 'other'.
| Tag Gtid_specification::generate_tag | ( | ) | const |
Returns tag object generated from internal tag data.
|
inline |
Helper function indicating whether this is an assigned GTID.
|
inline |
Helper function indicating whether this is to-be-generated GTID.
| true | This GTID will be generated |
| false | Other type of the GTID |
|
inlinestatic |
Helper function indicating whether this is to-be-generated GTID.
| [in] | type | Type of the GTID |
| true | This GTID will be generated |
| false | Other type of the GTID |
| bool Gtid_specification::is_automatic_tagged | ( | ) | const |
Helper function indicating whether this is to-be-generated GTID with a tag assigned.
| true | This GTID will be generated with assigned tag |
| false | Other type of the GTID |
|
static |
Returns true if the given string is a tagged Gtid_specification.
| [in] | text | Textual representation of the GTID specification |
|
inline |
Helper function indicating whether this is an undefined GTID.
|
static |
Returns true if the given string is a valid Gtid_specification.
| [in] | text | Textual representation of the GTID specification |
| Return_status Gtid_specification::parse | ( | Tsid_map * | tsid_map, |
| const char * | text | ||
| ) |
Parses the given string and stores in this Gtid_specification.
| tsid_map | tsid_map to use when converting TSID to a sidno. |
| text | The text to parse |
|
inline |
Debug only: print this Gtid_specification to stdout.
|
inline |
Set the type to ASSIGNED_GTID and TSID, GNO to the given Gtid.
gtid_param GTID to copy from
| void Gtid_specification::set | ( | const Gtid_specification & | other | ) |
Copy spec from other.
| [in] | other | Pattern to copy from |
Set the type to ASSIGNED_GTID and SIDNO, GNO to the given values.
|
inline |
Set the type to ANONYMOUS_GTID.
|
inline |
Set the type to AUTOMATIC_GTID.
|
inline |
Set the type to NOT_YET_DETERMINED_GTID.
|
inline |
Set to undefined. Must only be called if the type is ASSIGNED_GTID.
| int Gtid_specification::to_string | ( | const Tsid & | tsid, |
| char * | buf | ||
| ) | const |
Writes this Gtid_specification to the given string buffer.
| tsid | TSID to use if the type of this Gtid_specification is ASSIGNED_GTID. Can be NULL if this Gtid_specification is ANONYMOUS_GTID or AUTOMATIC_GTID. | |
| [out] | buf | The buffer |
| The | number of characters written. |
| int Gtid_specification::to_string | ( | const Tsid_map * | tsid_map, |
| char * | buf, | ||
| bool | need_lock = false |
||
| ) | const |
Writes this Gtid_specification to the given string buffer.
| tsid_map | Tsid_map to use if the type of this Gtid_specification is ASSIGNED_GTID. | |
| [out] | buf | The buffer |
| need_lock | If true, this function acquires global_tsid_lock before looking up the sidno in tsid_map, and then releases it. If false, this function asserts that the lock is held by the caller. |
| The | number of characters written. |
| Tag_plain Gtid_specification::automatic_tag |
Tag defined by the user while specifying GTID_NEXT="AUTOMATIC:TAG".
We must store here the information about tag, because automatic tagged GTID does not have sidno assigned
| Gtid Gtid_specification::gtid |
The GTID: { SIDNO, GNO } if type == GTID; { 0, 0 } if type == AUTOMATIC or ANONYMOUS.
|
static |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
| enum_gtid_type Gtid_specification::type |
The type of this GTID.