summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-21 18:15:05 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-21 18:15:05 +0000
commitffdb7c140be8f2326b09d92a5f0b131e76ea70aa (patch)
tree367262e2b93b9e154f11efca7cd2c60e25b63481
parent2909c94a61ace412c15489ca12a969c5d4026e41 (diff)
downloadhercules-ffdb7c140be8f2326b09d92a5f0b131e76ea70aa.tar.gz
hercules-ffdb7c140be8f2326b09d92a5f0b131e76ea70aa.tar.bz2
hercules-ffdb7c140be8f2326b09d92a5f0b131e76ea70aa.tar.xz
hercules-ffdb7c140be8f2326b09d92a5f0b131e76ea70aa.zip
* Fixed Sql_SetEncoding not setting the encoding of the connection properly. (fixes bugreport:30)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11774 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt2
-rw-r--r--src/common/sql.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index c83f80420..bc4f504c9 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -4,6 +4,8 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/11/21
+ * Fixed Sql_SetEncoding not setting the encoding of the connection
+ properly. (fixes bugreport:30)
* Added backward compatible target 'conf' to the Makefile. [FlavioJS]
* Changed Lif's Emergency Avoid to just get a normal skill delay
(blocks all skills, cancelled by mapchange / re-summon) instead of
diff --git a/src/common/sql.c b/src/common/sql.c
index 5df751643..0f61cbe72 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -145,7 +145,9 @@ int Sql_GetColumnNames(Sql* self, const char* table, char* out_buf, size_t buf_l
/// Changes the encoding of the connection.
int Sql_SetEncoding(Sql* self, const char* encoding)
{
- return Sql_Query(self, "SET NAMES %s", encoding);
+ if( self && mysql_set_character_set(self->handle, encoding) )
+ return SQL_SUCCESS;
+ return SQL_ERROR;
}
@@ -155,7 +157,7 @@ int Sql_Ping(Sql* self)
{
if( self && mysql_ping(&self->handle) == 0 )
return SQL_SUCCESS;
- return SQL_ERROR;
+ return SQL_ERROR;
}