summaryrefslogtreecommitdiff
path: root/src/common/sql.c
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 /src/common/sql.c
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
Diffstat (limited to 'src/common/sql.c')
-rw-r--r--src/common/sql.c6
1 files changed, 4 insertions, 2 deletions
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;
}