Fixed compiler issue on connecting to server binlog using binlog position or gtid.

This commit is contained in:
Jan Lindström
2013-08-08 10:32:08 +03:00
parent 685f3b0bda
commit 1f3665c8b0
10 changed files with 41 additions and 21 deletions

View File

@ -154,6 +154,16 @@ unsigned long Binary_log::get_position(std::string &filename)
return m_binlog_position;
}
int Binary_log::connect()
{
return m_driver->connect();
}
int Binary_log::connect(const boost::uint64_t binlog_pos)
{
return m_driver->connect(binlog_pos);
}
int Binary_log::connect(const Gtid gtid)
{
return m_driver->connect(gtid);

View File

@ -76,7 +76,9 @@ public:
Dummy_driver() : Binary_log_driver("", 0) {}
virtual ~Dummy_driver() {}
virtual int connect(Gtid gtid = Gtid()) { return 1; }
virtual int connect() { return 1; }
virtual int connect(const Gtid gtid) { return 1; }
virtual int connect(const boost::uint64_t binlog_pos) { return 1;}
virtual int wait_for_next_event(mysql::Binary_log_event **event) {
return ERR_EOF;
@ -94,11 +96,11 @@ public:
return ERR_OK;
}
virtual int fetch_server_version(const std::string& user,
virtual int fetch_server_version(const std::string& user,
const std::string& passwd,
const std::string& host,
const std::string& host,
long port)
{
{
return ERR_OK;
}
@ -124,7 +126,9 @@ public:
Binary_log(system::Binary_log_driver *drv, std::string);
~Binary_log() {}
int connect(Gtid gtid = Gtid());
int connect();
int connect(const Gtid gtid);
int connect(const boost::uint64_t binlog_pos);
/**
* Blocking attempt to get the next binlog event from the stream

View File

@ -57,8 +57,10 @@ public:
* @retval 0 Success
* @retval >0 Error code (to be specified)
*/
virtual int connect(Gtid gtid = Gtid())= 0;
virtual int connect(Gtid gtid)= 0;
virtual int connect() = 0;
virtual int connect(const boost::uint64_t binlog_pos) = 0;
/**
* Blocking attempt to get the next binlog event from the stream

View File

@ -951,11 +951,17 @@ int Binlog_tcp_driver::connect(const Gtid gtid)
return connect(m_user, m_passwd, m_host, m_port, gtid);
}
int Binlog_tcp_driver::connect(size_t binlog_pos)
int Binlog_tcp_driver::connect()
{
Gtid gtid = Gtid();
return connect(m_user, m_passwd, m_host, m_port, gtid);
}
int Binlog_tcp_driver::connect(boost::uint64_t binlog_pos)
{
Gtid gtid = Gtid();
std::string bf = std::string("");
return connect(m_user, m_passwd, m_host, m_port, gtid, bf, binlog_pos);
return connect(m_user, m_passwd, m_host, m_port, gtid, bf, (size_t)binlog_pos);
}
/**

View File

@ -76,8 +76,9 @@ public:
/**
* Connect using previously declared connection parameters.
*/
int connect(Gtid gtid = Gtid());
int connect(size_t binlog_pos);
int connect();
int connect(const Gtid gtid);
int connect(const boost::uint64_t binlog_pos);
/**
* Blocking wait for the next binary log event to reach the client