My Project
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
Gtid_specification Struct Reference

#include <rpl_gtid.h>

List of all members.

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_anonymous ()
 Set the type to ANONYMOUS_GROUP and SID, GNO to 0, 0.
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.


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.

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'.

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.

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.
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.
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]

Member Data Documentation

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


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines