MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Gtid_specification Struct Reference

#include <rpl_gtid.h>

Collaboration diagram for Gtid_specification:

Public Member Functions

void set (rpl_sidno sidno, rpl_gno gno)
 Set the type to GTID_GROUP and SID, GNO to the given values.
void set (const Gtid &gtid_param)
 Set the type to GTID_GROUP and SID, GNO to the given Gtid.
void set_automatic ()
 Set the type to AUTOMATIC_GROUP.
void set_undefined ()
 Set to undefined if the current type is GTID_GROUP.
void clear ()
 Set the type to GTID_GROUP and SID, GNO to 0, 0.
bool equals (const Gtid_specification &other) const
 Return true if this Gtid_specification is equal to 'other'.
bool equals (const Gtid &other_gtid) const
enum_return_status parse (Sid_map *sid_map, const char *text)
int to_string (const Sid_map *sid_map, char *buf) const
int to_string (const rpl_sid *sid, char *buf) const
void print () const
 Debug only: print this Gtid_specification to stdout.
void dbug_print (const char *text="") const

Static Public Member Functions

static enum_group_type get_type (const char *text)
static bool is_valid (const char *text)
 Returns true if the given string is a valid Gtid_specification.

Public Attributes

enum_group_type type
 The type of this GTID.
Gtid gtid

Static Public Attributes

static const int MAX_TEXT_LENGTH = Uuid::TEXT_LENGTH + 1 + MAX_GNO_TEXT_LENGTH

Detailed Description

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.

Definition at line 2375 of file rpl_gtid.h.

Member Function Documentation

void Gtid_specification::dbug_print ( const char *  text = "") const
inline

Print this Gtid_specificatoin to the trace file if debug is enabled; no-op otherwise.

Definition at line 2465 of file rpl_gtid.h.

Here is the call graph for this function:

bool Gtid_specification::equals ( const Gtid other_gtid) const
inline

Return true if this Gtid_specification is a GTID_GROUP with the same SID, GNO as 'other_gtid'.

Definition at line 2413 of file rpl_gtid.h.

Here is the call graph for this function:

enum_group_type Gtid_specification::get_type ( const char *  text)
static

Returns the type of the group, if the given string is a valid Gtid_specification; INVALID otherwise.

Definition at line 54 of file rpl_gtid_specification.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

enum_return_status Gtid_specification::parse ( Sid_map sid_map,
const char *  text 
)

Parses the given string and stores in this Gtid_specification.

Parameters
textThe text to parse
Returns
RETURN_STATUS_OK or RETURN_STATUS_REPORTED_ERROR.

Definition at line 29 of file rpl_gtid_specification.cc.

Here is the call graph for this function:

int Gtid_specification::to_string ( const Sid_map sid_map,
char *  buf 
) const

Writes this Gtid_specification to the given string buffer.

Parameters
sid_mapSid_map to use if the type of this Gtid_specification is GTID_GROUP.
buf[out]The buffer
Return values
Thenumber of characters written.

Definition at line 95 of file rpl_gtid_specification.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

int Gtid_specification::to_string ( const rpl_sid sid,
char *  buf 
) const

Writes this Gtid_specification to the given string buffer.

Parameters
sidSID to use if the type of this Gtid_specification is GTID_GROUP. Can be NULL if this Gtid_specification is ANONYMOUS_GROUP or AUTOMATIC_GROUP.
buf[out]The buffer
Return values
Thenumber of characters written. [out]

Definition at line 69 of file rpl_gtid_specification.cc.

Here is the call graph for this function:

Member Data Documentation

Gtid Gtid_specification::gtid

The GTID: { SIDNO, GNO } if type == GTID; { 0, 0 } if type == AUTOMATIC or ANONYMOUS.

Definition at line 2384 of file rpl_gtid.h.


The documentation for this struct was generated from the following files: