aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.cpp
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2015-03-28 16:03:41 +0100
committerNaios <naios-dev@live.de>2015-03-28 17:25:16 +0100
commit11e1f4af6046cf3c8729cf31e24c605650b71d06 (patch)
treef01ac8e934472f1054a39ed9876bf580d710aa67 /src/server/shared/Database/MySQLConnection.cpp
parent90b1e7d621960aea0becd8ac2c5299c02f03f3cf (diff)
Core/Database Improve commit 39bdd06446dc
* found a better way where no cast is needed. * ref #14430 (cherry picked from commit 54ee5267244acac16e4b56342e64c0235ee0599b)
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index bea0b934eb9..5a98757abb5 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -137,9 +137,7 @@ uint32 MySQLConnection::Open()
// set connection properties to UTF8 to properly handle locales for different
// server configs - core sends data in UTF8, so MySQL must expect UTF8 too
mysql_set_character_set(m_Mysql, "utf8");
-
- // Prepare statements only at reconnect
- return m_reconnecting ? static_cast<uint32>(PrepareStatements()) : 0;
+ return 0;
}
else
{
@@ -493,7 +491,9 @@ bool MySQLConnection::_HandleMySQLErrno(uint32 errNo)
m_reconnecting = true;
uint64 oldThreadId = mysql_thread_id(GetHandle());
mysql_close(GetHandle());
- if (this->Open()) // Don't remove 'this' pointer unless you want to skip loading all prepared statements....
+
+ // Don't remove 'this' pointer unless you want to skip loading all prepared statements....
+ if (this->Open() && this->PrepareStatements())
{
TC_LOG_INFO("sql.sql", "Connection to the MySQL server is active.");
if (oldThreadId != mysql_thread_id(GetHandle()))