mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Database: Fixed WITH_COREDEBUG + WITH_DYNAMIC_LINKING incompatibility on windows
This commit is contained in:
@@ -51,6 +51,14 @@
|
||||
#define MIN_MARIADB_CLIENT_VERSION 30003u
|
||||
#define MIN_MARIADB_CLIENT_VERSION_STRING "3.0.3"
|
||||
|
||||
namespace
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
template<typename Database>
|
||||
thread_local bool WarnSyncQueries = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
struct DatabaseWorkerPool<T>::QueueSizeTracker
|
||||
{
|
||||
@@ -426,6 +434,14 @@ void DatabaseWorkerPool<T>::KeepAlive()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef TRINITY_DEBUG
|
||||
template <class T>
|
||||
void DatabaseWorkerPool<T>::WarnAboutSyncQueries([[maybe_unused]] bool warn)
|
||||
{
|
||||
WarnSyncQueries<T> = warn;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
uint32 DatabaseWorkerPool<T>::OpenConnections(InternalIndex type, uint8 numConnections)
|
||||
{
|
||||
@@ -485,7 +501,7 @@ template <class T>
|
||||
T* DatabaseWorkerPool<T>::GetFreeConnection()
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (_warnSyncQueries)
|
||||
if (WarnSyncQueries<T>)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << boost::stacktrace::stacktrace();
|
||||
|
||||
@@ -204,12 +204,11 @@ class DatabaseWorkerPool
|
||||
//! Keeps all our MySQL connections alive, prevent the server from disconnecting us.
|
||||
void KeepAlive();
|
||||
|
||||
void WarnAboutSyncQueries([[maybe_unused]] bool warn)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
_warnSyncQueries = warn;
|
||||
static void WarnAboutSyncQueries(bool warn);
|
||||
#else
|
||||
static void WarnAboutSyncQueries([[maybe_unused]] bool warn) { }
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t QueueSize() const;
|
||||
|
||||
@@ -236,9 +235,6 @@ class DatabaseWorkerPool
|
||||
std::unique_ptr<MySQLConnectionInfo> _connectionInfo;
|
||||
std::vector<uint8> _preparedStatementSize;
|
||||
uint8 _async_threads, _synch_threads;
|
||||
#ifdef TRINITY_DEBUG
|
||||
static inline thread_local bool _warnSyncQueries = false;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user