diff options
author | bar@mysql.com <> | 2004-08-27 12:09:28 +0500 |
---|---|---|
committer | bar@mysql.com <> | 2004-08-27 12:09:28 +0500 |
commit | 5258ea12cf1ccc723e6bb304a1fbe0e3abf1d204 (patch) | |
tree | 58ed946662e8b604d530e75ae74ba349975a56c6 | |
parent | 43b792d5cfa7cee89616197d72206d8dd42ce97d (diff) | |
download | mariadb-git-5258ea12cf1ccc723e6bb304a1fbe0e3abf1d204.tar.gz |
table.cc:
Bug #4558 Escape handling error for ENUM values in SJIS encoding
-rw-r--r-- | sql/table.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 7e6338a3f3f..898ed4bca3d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -993,8 +993,26 @@ ulong next_io_size(register ulong pos) void append_unescaped(String *res,const char *pos) { - for (; *pos ; pos++) +#ifdef USE_MB + const char *end= pos + strlen(pos); +#endif + + for (; *pos ; ) { +#ifdef USE_MB + /* + Note, there is no needs to propagate this code into 4.1. + */ + uint mblen; + if (use_mb(default_charset_info) && + (mblen= my_ismbchar(default_charset_info, pos, end))) + { + res->append(pos, mblen); + pos+= mblen; + continue; + } +#endif + switch (*pos) { case 0: /* Must be escaped for 'mysql' */ res->append('\\'); @@ -1020,6 +1038,7 @@ void append_unescaped(String *res,const char *pos) res->append(*pos); break; } + pos++; } } |