diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-03-16 10:55:12 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-03-16 10:55:12 +0400 |
commit | e09299511e83f11f7476f7ea6c81ee12b00d7050 (patch) | |
tree | a3544293e29a5d191f2b07ce1810f58e257b1b10 /sql/sql_table.cc | |
parent | dc08ccab422098d2466fa342d577f03c941a4ffc (diff) | |
download | mariadb-git-e09299511e83f11f7476f7ea6c81ee12b00d7050.tar.gz |
MDEV-9665 Remove cs->cset->ismbchar()
Using a more powerfull cs->cset->charlen() instead.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 5903f8420b2..7f3b4fe6595 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -90,7 +90,7 @@ static char* add_identifier(THD* thd, char *to_p, const char * end_p, { uint res; uint errors; - const char *conv_name; + const char *conv_name, *conv_name_end; char tmp_name[FN_REFLEN]; char conv_string[FN_REFLEN]; int quote; @@ -111,11 +111,13 @@ static char* add_identifier(THD* thd, char *to_p, const char * end_p, { DBUG_PRINT("error", ("strconvert of '%s' failed with %u (errors: %u)", conv_name, res, errors)); conv_name= name; + conv_name_end= name + name_len; } else { DBUG_PRINT("info", ("conv '%s' -> '%s'", conv_name, conv_string)); conv_name= conv_string; + conv_name_end= conv_string + res; } quote = thd ? get_quote_char_for_identifier(thd, conv_name, res - 1) : '"'; @@ -125,8 +127,8 @@ static char* add_identifier(THD* thd, char *to_p, const char * end_p, *(to_p++)= (char) quote; while (*conv_name && (end_p - to_p - 1) > 0) { - uint length= my_mbcharlen(system_charset_info, *conv_name); - if (!length) + int length= my_charlen(system_charset_info, conv_name, conv_name_end); + if (length <= 0) length= 1; if (length == 1 && *conv_name == (char) quote) { |