summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c16
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