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:
Markus Mäkelä
2018-01-22 09:45:28 +02:00
parent ef53ded057
commit 3ade3f68a7

View File

@ -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 = {};