From dfd82c2faddd00384000d96590fad07957ea6b31 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sun, 19 Dec 2010 16:13:45 +0100 Subject: Core/DBLayer: Use mysql_set_character_set in MySQLConnection::Open instead of explicit string queries Also possibly fix an absolutely useless warning on GCC --HG-- branch : trunk --- src/server/shared/Database/MySQLConnection.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/server/shared/Database/MySQLConnection.cpp') diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp index b41cab510ed..de61153b125 100755 --- a/src/server/shared/Database/MySQLConnection.cpp +++ b/src/server/shared/Database/MySQLConnection.cpp @@ -36,18 +36,18 @@ MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) : m_queue(NULL), m_worker(NULL), m_Mysql(NULL), +m_reconnecting(false), m_connectionInfo(connInfo), -m_connectionFlags(CONNECTION_SYNCH), -m_reconnecting(false) +m_connectionFlags(CONNECTION_SYNCH) { } MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInfo& connInfo) : m_queue(queue), m_Mysql(NULL), +m_reconnecting(false), m_connectionInfo(connInfo), -m_connectionFlags(CONNECTION_ASYNC), -m_reconnecting(false) +m_connectionFlags(CONNECTION_ASYNC) { m_worker = new DatabaseWorker(m_queue, this); } @@ -131,8 +131,7 @@ bool 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 - Execute("SET NAMES `utf8`"); - Execute("SET CHARACTER SET `utf8`"); + mysql_set_character_set(m_Mysql, "utf8"); return true; } else -- cgit v1.2.3