MXS-1538: Prevent double connecting
Connector::connect now checks whether a connection is already made before attempting to create another one.
This commit is contained in:
@ -198,6 +198,12 @@ bool Connection::connect(const std::string& table, const std::string& gtid)
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (m_connected)
|
||||||
|
{
|
||||||
|
m_error = "Already connected";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
m_error.clear();
|
m_error.clear();
|
||||||
|
|
||||||
struct addrinfo *ai = NULL, hint = {};
|
struct addrinfo *ai = NULL, hint = {};
|
||||||
|
Reference in New Issue
Block a user