mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Updater: Fix issues when connecting through unix sockets.
* closes #14766 * closes #14759 Signed-off-by: Naios <naios-dev@live.de>
This commit is contained in:
@@ -349,8 +349,27 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
|
||||
args.push_back("-h" + host);
|
||||
args.push_back("-u" + user);
|
||||
args.push_back("-p" + password);
|
||||
|
||||
// Check if we want to connect through ip or socket (Unix only)
|
||||
#ifdef _WIN32
|
||||
|
||||
args.push_back("-P" + port_or_socket);
|
||||
|
||||
#else
|
||||
|
||||
if (!std::isdigit(port_or_socket[0]))
|
||||
{
|
||||
// We can't check here if host == "." because is named localhost if socket option is enabled
|
||||
args.push_back("-P0");
|
||||
args.push_back("--protocol=SOCKET");
|
||||
args.push_back("-S" + port_or_socket);
|
||||
}
|
||||
else
|
||||
// generic case
|
||||
args.push_back("-P" + port_or_socket);
|
||||
|
||||
#endif
|
||||
|
||||
// Set the default charset to utf8
|
||||
args.push_back("--default-character-set=utf8");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user