Merge branch '2.3' into 2.4

This commit is contained in:
Markus Mäkelä
2020-09-01 09:15:56 +03:00
3 changed files with 45 additions and 15 deletions

View File

@ -305,19 +305,13 @@ public:
mysql_close(m_conn);
}
bool connect()
void ssl(bool value)
{
mysql_close(m_conn);
m_conn = mysql_init(NULL);
// MXS-2568: This fixes mxs1828_double_local_infile
mysql_optionsv(m_conn, MYSQL_OPT_LOCAL_INFILE, (void*)"1");
return mysql_real_connect(m_conn, m_host.c_str(), m_user.c_str(), m_pw.c_str(), m_db.c_str(), m_port,
NULL, CLIENT_MULTI_STATEMENTS)
&& mysql_errno(m_conn) == 0;
m_ssl = value;
}
bool connect();
void disconnect()
{
mysql_close(m_conn);

View File

@ -604,3 +604,21 @@ int get_int_version(std::string version)
str >> major >> dot >> minor >> dot >> patch;
return major * 10000 + minor * 100 + patch;
}
bool Connection::connect()
{
mysql_close(m_conn);
m_conn = mysql_init(NULL);
// MXS-2568: This fixes mxs1828_double_local_infile
mysql_optionsv(m_conn, MYSQL_OPT_LOCAL_INFILE, (void*)"1");
if (m_ssl)
{
set_ssl(m_conn);
}
return mysql_real_connect(m_conn, m_host.c_str(), m_user.c_str(), m_pw.c_str(), m_db.c_str(), m_port,
NULL, CLIENT_MULTI_STATEMENTS)
&& mysql_errno(m_conn) == 0;
}