From c4e79f4d3bd6c16c7429355a8a956102cc33b4c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 15 Jul 2020 13:30:41 +0300 Subject: [PATCH] Prevent unwanted connection errors The Connection class used the wrapper function when it could simply call mysql_real_connect directly. This removes the unconditional error message that would be printed even when a connection failure was expected. --- .../maxtest/include/maxtest/mariadb_func.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/maxscale-system-test/maxtest/include/maxtest/mariadb_func.h b/maxscale-system-test/maxtest/include/maxtest/mariadb_func.h index b45254f5a..8a2a3d08d 100644 --- a/maxscale-system-test/maxtest/include/maxtest/mariadb_func.h +++ b/maxscale-system-test/maxtest/include/maxtest/mariadb_func.h @@ -308,8 +308,14 @@ public: bool connect() { mysql_close(m_conn); - m_conn = open_conn_db(m_port, m_host, m_db, m_user, m_pw, m_ssl); - return m_conn != nullptr && mysql_errno(m_conn) == 0; + 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; } void disconnect()