diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-04 00:16:16 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-04 00:16:16 +0000 |
commit | 3e56cb4d7dd63528c371a7fb033b291f70daa38f (patch) | |
tree | 2a4af6c34db829a9ca8f819c6cbe0bba19226304 /src | |
parent | fd34899afa1d00bcfd740e5802c534d282054fbb (diff) | |
download | hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.gz hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.bz2 hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.tar.xz hercules-3e56cb4d7dd63528c371a7fb033b291f70daa38f.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/char_sql/char.c | 16 |
1 files changed, 10 insertions, 6 deletions
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 |