summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-08-27 12:09:28 +0500
committerunknown <bar@mysql.com>2004-08-27 12:09:28 +0500
commit14f96b2f6059471cb2f1addb94ecfdcdb09bf071 (patch)
tree58ed946662e8b604d530e75ae74ba349975a56c6
parentdd714c9a1b6f7e98e4e9b3397a4b84144fb4e181 (diff)
downloadmariadb-git-14f96b2f6059471cb2f1addb94ecfdcdb09bf071.tar.gz
table.cc:
Bug #4558 Escape handling error for ENUM values in SJIS encoding sql/table.cc: Bug #4558 Escape handling error for ENUM values in SJIS encoding
-rw-r--r--sql/table.cc21
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++;
}
}