Fix an incompatibility between MySQL and MariaDB.

This commit is contained in:
Sadie Powell 2022-12-18 18:44:42 +00:00
parent 3af79a556e
commit 1ac8bbe178

View File

@ -342,8 +342,10 @@ class SQLConnection : public SQL::Provider
mysql_options(connection, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
// Enable SSL if requested.
#if defined LIBMYSQL_VERSION_ID && LIBMYSQL_VERSION_ID > 80000
unsigned int ssl = config->getBool("ssl") ? SSL_MODE_REQUIRED : SSL_MODE_PREFERRED;
mysql_options(connection, MYSQL_OPT_SSL_MODE, &ssl);
#endif
// Attempt to connect to the database.
const std::string host = config->getString("host");