Added SQL_SetCharset native to (re)set charset even after reconnect (bug 5786, r=psychonic).
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user