From 5258ea12cf1ccc723e6bb304a1fbe0e3abf1d204 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 27 Aug 2004 12:09:28 +0500 Subject: table.cc: Bug #4558 Escape handling error for ENUM values in SJIS encoding --- sql/table.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'sql/table.cc') 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++; } } -- cgit v1.2.1 From f574cd4e8f7f9794385cf5b9f6ddfc8530245005 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Sat, 28 Aug 2004 00:49:54 +0300 Subject: Code style fixes. Initialize LOG_error_log before get_options to not use an uninitalized mutex in case of an error from handle_options() --- sql/table.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sql/table.cc') diff --git a/sql/table.cc b/sql/table.cc index 898ed4bca3d..573fa11a4c4 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -999,10 +999,7 @@ void append_unescaped(String *res,const char *pos) for (; *pos ; ) { -#ifdef USE_MB - /* - Note, there is no needs to propagate this code into 4.1. - */ +#if defined(USE_MB) && MYSQL_VERSION_ID < 40100 uint mblen; if (use_mb(default_charset_info) && (mblen= my_ismbchar(default_charset_info, pos, end))) -- cgit v1.2.1 From dec44916c141565b41ddfcccdb3e9755b82bd744 Mon Sep 17 00:00:00 2001 From: "monty@mysql.com" <> Date: Thu, 2 Sep 2004 16:57:26 +0300 Subject: After merge fixes --- sql/table.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/table.cc') diff --git a/sql/table.cc b/sql/table.cc index eb3e0e8d1a7..8b018d61e5a 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1120,7 +1120,6 @@ void append_unescaped(String *res, const char *pos, uint length) res->append(*pos); break; } - pos++; } res->append('\''); } -- cgit v1.2.1