diff options
author | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2017-06-19 23:20:06 -0300 |
commit | 85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch) | |
tree | df3d2084ee2e35008903c03178039b9c986e2d08 /src/server/database/Updater/DBUpdater.cpp | |
parent | 052fc24315ace866ea1cf610e85df119b68100c9 (diff) |
Core: ported headers cleanup from master branch
Diffstat (limited to 'src/server/database/Updater/DBUpdater.cpp')
-rw-r--r-- | src/server/database/Updater/DBUpdater.cpp | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/server/database/Updater/DBUpdater.cpp b/src/server/database/Updater/DBUpdater.cpp index 104533c1573..b82e0919dab 100644 --- a/src/server/database/Updater/DBUpdater.cpp +++ b/src/server/database/Updater/DBUpdater.cpp @@ -16,17 +16,18 @@ */ #include "DBUpdater.h" -#include "Log.h" -#include "GitRevision.h" -#include "UpdateFetcher.h" -#include "DatabaseLoader.h" -#include "Config.h" #include "BuiltInConfig.h" +#include "Config.h" +#include "DatabaseEnv.h" +#include "DatabaseLoader.h" +#include "GitRevision.h" +#include "Log.h" +#include "QueryResult.h" #include "StartProcess.h" - +#include "UpdateFetcher.h" +#include <boost/filesystem/operations.hpp> #include <fstream> #include <iostream> -#include <unordered_map> std::string DBUpdaterUtil::GetCorrectedMySQLExecutable() { @@ -41,18 +42,12 @@ bool DBUpdaterUtil::CheckExecutable() boost::filesystem::path exe(GetCorrectedMySQLExecutable()); if (!exists(exe)) { - exe.clear(); - - if (auto path = Trinity::SearchExecutableInPath("mysql")) + exe = Trinity::SearchExecutableInPath("mysql"); + if (!exe.empty() && exists(exe)) { - exe = std::move(*path); - - if (!exe.empty() && exists(exe)) - { - // Correct the path to the cli - corrected_path() = absolute(exe).generic_string(); - return true; - } + // Correct the path to the cli + corrected_path() = absolute(exe).generic_string(); + return true; } TC_LOG_FATAL("sql.updates", "Didn't find any executable MySQL binary at \'%s\' or in path, correct the path in the *.conf (\"MySQLExecutable\").", @@ -313,7 +308,7 @@ bool DBUpdater<T>::Populate(DatabaseWorkerPool<T>& pool) template<class T> QueryResult DBUpdater<T>::Retrieve(DatabaseWorkerPool<T>& pool, std::string const& query) { - return pool.PQuery(query.c_str()); + return pool.Query(query.c_str()); } template<class T> |