Fixes to MySQL GTID handling. Still can't execute COM_BINLOG_DUMP_GTID.

This commit is contained in:
Jan Lindström
2013-07-12 12:30:24 +03:00
parent 59b0eee999
commit 427fee618a
10 changed files with 204 additions and 251 deletions

View File

@ -186,7 +186,7 @@ public:
boost::uint32_t domain_id;
boost::uint32_t server_id;
boost::uint64_t sequence_number;
std::string m_mysql_gtid;
char m_mysql_gtid[MYSQL_GTID_ENCODED_SIZE];
Gtid m_gtid;
};

View File

@ -44,28 +44,32 @@ enum mysql_server_types {
MYSQL_SERVER_TYPE_MYSQL = 2
};
#define MYSQL_GTID_ENCODED_SIZE 24
class Gtid
{
public:
Gtid()
: m_real_gtid(false), m_domain_id(0), m_server_id(0), m_sequence_number(0), m_mysql_gtid(""), m_server_type(MYSQL_SERVER_TYPE_NA)
{}
: m_real_gtid(false), m_domain_id(0), m_server_id(0), m_sequence_number(0), m_server_type(MYSQL_SERVER_TYPE_NA)
{
memset(m_mysql_gtid, 0, MYSQL_GTID_ENCODED_SIZE);
}
Gtid(const boost::uint32_t domain_id,
const boost::uint32_t server_id,
const boost::uint64_t sequence_number);
Gtid(const std::string &mysql_gtid,
Gtid(const char *mysql_gtid,
const boost::uint64_t gno);
Gtid(const std::string &mysql_gtid);
Gtid(const char *mysql_gtid);
~Gtid() {}
bool is_real_gtid() const { return m_real_gtid;}
const std::string& get_mysql_gtid() const { return m_mysql_gtid; }
const char* get_mysql_gtid() const { return m_mysql_gtid; }
std::string get_string() const;
@ -82,7 +86,7 @@ class Gtid
boost::uint32_t m_server_id;
boost::uint64_t m_sequence_number;
std::string m_mysql_gtid;
char m_mysql_gtid[MYSQL_GTID_ENCODED_SIZE];
};
}