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
This commit is contained in:
Machiavelli
2010-12-19 16:13:45 +01:00
parent e2a8dfffbe
commit dfd82c2fad

View File

@@ -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