mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
refactor(Deps/MySQL): Drop MariaDB and MySQL 5.7/8.1 and add MySQL 8.… (#19451)
This commit is contained in:
@@ -59,15 +59,10 @@ DatabaseWorkerPool<T>::DatabaseWorkerPool() :
|
||||
{
|
||||
WPFatal(mysql_thread_safe(), "Used MySQL library isn't thread-safe.");
|
||||
|
||||
#if !defined(MARIADB_VERSION_ID) || MARIADB_VERSION_ID < 100600
|
||||
bool isSupportClientDB = mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION;
|
||||
bool isSameClientDB = mysql_get_client_version() == MYSQL_VERSION_ID;
|
||||
#else // MariaDB 10.6+
|
||||
bool isSupportClientDB = mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION;
|
||||
bool isSameClientDB = true; // Client version 3.2.3?
|
||||
#endif
|
||||
|
||||
WPFatal(isSupportClientDB, "AzerothCore does not support MySQL versions below 5.7 or MariaDB versions below 10.5.\n\nFound version: {} / {}. Server compiled with: {}.\nSearch the wiki for ACE00043 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00043).",
|
||||
WPFatal(isSupportClientDB, "AzerothCore does not support MySQL versions below 8.0\n\nFound version: {} / {}. Server compiled with: {}.\nSearch the wiki for ACE00043 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00043).",
|
||||
mysql_get_client_info(), mysql_get_client_version(), MYSQL_VERSION_ID);
|
||||
WPFatal(isSameClientDB, "Used MySQL library version ({} id {}) does not match the version id used to compile AzerothCore (id {}).\nSearch the wiki for ACE00046 in Common Errors (https://www.azerothcore.org/wiki/common-errors#ace00046).",
|
||||
mysql_get_client_info(), mysql_get_client_version(), MYSQL_VERSION_ID);
|
||||
@@ -378,8 +373,6 @@ void DatabaseWorkerPool<T>::KeepAlive()
|
||||
*
|
||||
* DatabaseIncompatibleVersion("8.0.35") => false
|
||||
* DatabaseIncompatibleVersion("5.6.6") => true
|
||||
* DatabaseIncompatibleVersion("5.5.5-10.5.5-MariaDB") => false
|
||||
* DatabaseIncompatibleVersion("5.5.5-10.4.0-MariaDB") => true
|
||||
*
|
||||
* Adapted from stackoverflow response
|
||||
* https://stackoverflow.com/a/2941508
|
||||
@@ -410,17 +403,6 @@ bool DatabaseIncompatibleVersion(std::string const mysqlVersion)
|
||||
uint8 offset = 0;
|
||||
std::string minVersion = MIN_MYSQL_SERVER_VERSION;
|
||||
|
||||
// If the version string contains "MariaDB", use that
|
||||
if (mysqlVersion.find("MariaDB") != std::string::npos)
|
||||
{
|
||||
// All MariaDB 10.X versions have a prefix of 5.5.5 from the
|
||||
// mysql_get_server_info() function. To make matters more
|
||||
// annoying, this is removed in MariaDB 11.X
|
||||
if (mysqlVersion.rfind("5.5.5-", 0) == 0)
|
||||
offset = 6;
|
||||
minVersion = MIN_MARIADB_SERVER_VERSION;
|
||||
}
|
||||
|
||||
auto parsedMySQLVersion = parse(mysqlVersion.substr(offset));
|
||||
auto parsedMinVersion = parse(minVersion);
|
||||
|
||||
@@ -455,7 +437,7 @@ uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConne
|
||||
}
|
||||
else if (DatabaseIncompatibleVersion(connection->GetServerInfo()))
|
||||
{
|
||||
LOG_ERROR("sql.driver", "AzerothCore does not support MySQL versions below 5.7 or MariaDB versions below 10.5.\n\nFound server version: {}. Server compiled with: {}.",
|
||||
LOG_ERROR("sql.driver", "AzerothCore does not support MySQL versions below 8.0\n\nFound server version: {}. Server compiled with: {}.",
|
||||
connection->GetServerInfo(), MYSQL_VERSION_ID);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user