Core/DBLayer: Fix compilation with mysql 8

(cherry picked from commit 579d41acc5)
This commit is contained in:
Shauren
2020-04-08 09:44:52 +02:00
parent 321bc3ccfa
commit 3b4a2a0a94

View File

@@ -134,12 +134,21 @@ uint32 MySQLConnection::Open()
if (m_connectionInfo.ssl != "")
{
my_bool opt_use_ssl = false;
#if !defined(MARIADB_VERSION_ID) && MYSQL_VERSION_ID >= 80000
mysql_ssl_mode opt_use_ssl = SSL_MODE_DISABLED;
if (m_connectionInfo.ssl == "ssl")
{
opt_use_ssl = true;
opt_use_ssl = SSL_MODE_REQUIRED;
}
mysql_options(mysqlInit, MYSQL_OPT_SSL_MODE, (char const*)&opt_use_ssl);
#else
MySQLBool opt_use_ssl = MySQLBool(0);
if (m_connectionInfo.ssl == "ssl")
{
opt_use_ssl = MySQLBool(1);
}
mysql_options(mysqlInit, MYSQL_OPT_SSL_ENFORCE, (char const*)&opt_use_ssl);
#endif
}
m_Mysql = reinterpret_cast<MySQLHandle*>(mysql_real_connect(mysqlInit, m_connectionInfo.host.c_str(), m_connectionInfo.user.c_str(),