From 3e56cb4d7dd63528c371a7fb033b291f70daa38f Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 4 Jan 2012 00:16:16 +0000 Subject: Fixed char-server not making use of name_ignoring_case setting, bugreport:4700 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15374 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/char.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/char_sql') diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 3e3f12c62..78cd67d79 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -1325,12 +1325,16 @@ int check_char_name(char * name, char * esc_name) if( strchr(char_name_letters, name[i]) != NULL ) return -2; } - - // check name (already in use?) - if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) ) - { - Sql_ShowDebug(sql_handle); - return -2; + if( name_ignoring_case ) { + if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE BINARY `name` = '%s' LIMIT 1", char_db, esc_name) ) { + Sql_ShowDebug(sql_handle); + return -2; + } + } else { + if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `name` = '%s' LIMIT 1", char_db, esc_name) ) { + Sql_ShowDebug(sql_handle); + return -2; + } } if( Sql_NumRows(sql_handle) > 0 ) return -1; // name already exists -- cgit v1.2.3-70-g09d2