MySQL 8.0.40
Source Code Documentation
|
This struct represents a specification of a GTID for a statement to be executed: either "AUTOMATIC", "ANONYMOUS", or "SID:GNO". More...
#include <rpl_gtid.h>
Public Member Functions | |
void | set (rpl_sidno sidno, rpl_gno gno) |
Set the type to ASSIGNED_GTID and SID, GNO to the given values. More... | |
void | set (const Gtid >id_param) |
Set the type to ASSIGNED_GTID and SID, GNO to the given Gtid. More... | |
void | set_automatic () |
Set the type to AUTOMATIC_GTID. 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 SID, GNO as 'other_gtid'. More... | |
enum_return_status | parse (Sid_map *sid_map, const char *text) |
Parses the given string and stores in this Gtid_specification. More... | |
int | to_string (const Sid_map *sid_map, char *buf, bool need_lock=false) const |
Writes this Gtid_specification to the given string buffer. More... | |
int | to_string (const rpl_sid *sid, 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_valid (const char *text) |
Returns true if the given string is a valid 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... | |
Static Public Attributes | |
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", "ANONYMOUS", or "SID:GNO".
This is a POD. It has to be a POD because it is used in THD::variables.
|
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 SID, GNO as 'other_gtid'.
|
inline |
Return true if this Gtid_specification is equal to 'other'.
|
static |
Returns true if the given string is a valid Gtid_specification.
enum_return_status Gtid_specification::parse | ( | Sid_map * | sid_map, |
const char * | text | ||
) |
Parses the given string and stores in this Gtid_specification.
sid_map | sid_map to use when converting SID 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 SID, GNO to the given Gtid.
Set the type to ASSIGNED_GTID and SID, 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 rpl_sid * | sid, |
char * | buf | ||
) | const |
Writes this Gtid_specification to the given string buffer.
sid | SID 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 Sid_map * | sid_map, |
char * | buf, | ||
bool | need_lock = false |
||
) | const |
Writes this Gtid_specification to the given string buffer.
sid_map | Sid_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_sid_lock before looking up the sidno in sid_map, and then releases it. If false, this function asserts that the lock is held by the caller. |
The | number of characters written. |
Gtid Gtid_specification::gtid |
The GTID: { SIDNO, GNO } if type == GTID; { 0, 0 } if type == AUTOMATIC or ANONYMOUS.
|
static |
enum_gtid_type Gtid_specification::type |
The type of this GTID.