Added SQL_SetCharset native to (re)set charset even after reconnect (bug 5786, r=psychonic).

This commit is contained in:
Peace-Maker
2013-07-18 10:27:12 -04:00
parent 5a5d8d2d07
commit 69d8b1c30d
7 changed files with 51 additions and 1 deletions
+5
View File
@@ -326,3 +326,8 @@ IDBDriver *MyDatabase::GetDriver()
{
return &g_MyDriver;
}
bool MyDatabase::SetCharacterSet(const char *characterset)
{
return mysql_set_character_set(m_mysql, characterset) == 0 ? true : false;
}
+1
View File
@@ -62,6 +62,7 @@ public: //IDatabase
IQuery *DoQueryEx(const char *query, size_t len);
unsigned int GetAffectedRowsForQuery(IQuery *query);
unsigned int GetInsertIDForQuery(IQuery *query);
bool SetCharacterSet(const char *characterset);
public:
const DatabaseInfo &GetInfo();
private:
+6
View File
@@ -254,3 +254,9 @@ sqlite3 *SqDatabase::GetDb()
{
return m_sq3;
}
bool SqDatabase::SetCharacterSet(const char *characterset)
{
// sqlite only supports utf8 and utf16 - by the time the database is created. It's too late here.
return false;
}
+1
View File
@@ -58,6 +58,7 @@ public:
IQuery *DoQueryEx(const char *query, size_t len);
unsigned int GetAffectedRowsForQuery(IQuery *query);
unsigned int GetInsertIDForQuery(IQuery *query);
bool SetCharacterSet(const char *characterset);
public:
sqlite3 *GetDb();
private: