MySQL 8.4.2
Source Code Documentation
|
Represents a MySQL Global Transaction Identifier. More...
#include <gtid.h>
Public Member Functions | |
Gtid ()=default | |
Construct an empty GTID. More... | |
Gtid (const Tsid &tsid, gno_t gno) | |
Construct a new Gtid object. More... | |
virtual | ~Gtid () |
Destroy the Gtid object. More... | |
virtual gno_t | get_gno () const |
Get the sequence number of this transaction identifier. More... | |
virtual const Uuid & | get_uuid () const |
Get the uuid of this transaction identifier. More... | |
virtual const Tsid & | get_tsid () const |
Get the tsid of this transaction identifier. More... | |
virtual const Tag & | get_tag () const |
Get the tag of this transaction identifier. More... | |
virtual std::string | to_string () const |
Gets a human readable representation of this transaction identifier. More... | |
virtual std::size_t | encode_gtid_tagged (unsigned char *buf) const |
Encodes GTID into a binary format. More... | |
virtual std::size_t | decode_gtid_tagged (const unsigned char *buf, std::size_t buf_len) |
Decodes GTID from a given buffer. More... | |
virtual bool | operator== (const Gtid &other) const |
Compares two identifiers and returns whether they match or not. More... | |
virtual bool | operator!= (const Gtid &other) const |
Compares two identifiers and returns whether they are different. More... | |
virtual Gtid & | operator= (const Gtid &other) |
Copy assignment. More... | |
Gtid (const Gtid &other) | |
Construct a new Gtid object from another one, by deep copying its contents. More... | |
Static Public Member Functions | |
static constexpr std::size_t | get_max_encoded_length () |
Gets maximum length of encoded GTID in compile time. More... | |
Static Public Attributes | |
static constexpr auto | separator_gtid {':'} |
In 'UUID:SEQNO', this is the ':'. More... | |
Protected Attributes | |
Tsid | m_tsid |
gno_t | m_gno {0} |
Represents a MySQL Global Transaction Identifier.
This class abstracts the representation of a Global Transaction Identifier.
It contains two fields, a TSID, composed of UUID and tag, and a sequence number.
|
default |
Construct an empty GTID.
Construct a new Gtid object.
tsid | TSID part of the transaction identifier |
gno | The gno part of the transaction identfier. |
|
virtualdefault |
Destroy the Gtid object.
Gtid::Gtid | ( | const Gtid & | other | ) |
Construct a new Gtid object from another one, by deep copying its contents.
other | the other gtid to construct this gtid from. |
|
virtual |
Decodes GTID from a given buffer.
Supported is only tagged format of a GTID. Buf must contain required number of bytes
buf | Buffer to read from |
buf_len | Buffer length in bytes |
|
virtual |
Encodes GTID into a binary format.
Supported is only tagged format of a GTID. Buf must be preallocated with a required number of bytes
buf | Buffer to write to |
|
virtual |
Get the sequence number of this transaction identifier.
|
inlinestaticconstexpr |
Gets maximum length of encoded GTID in compile time.
|
virtual |
Get the tag of this transaction identifier.
|
virtual |
Get the tsid of this transaction identifier.
|
virtual |
Get the uuid of this transaction identifier.
|
virtual |
Compares two identifiers and returns whether they are different.
other | The other transaction identifier to compare to this one. |
Copy assignment.
Note that this operator will do a deep copy of the other identifier.
other | Copies the uuid and gno of the other identifier. |
|
virtual |
Compares two identifiers and returns whether they match or not.
other | The other transaction identifier to compare to this one. |
|
virtual |
Gets a human readable representation of this transaction identifier.
|
protected |
|
protected |
|
staticconstexpr |
In 'UUID:SEQNO', this is the ':'.