From 1570873c6b6e0b5a7529105c0e5b76c4f662c43d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 11:35:14 +0200 Subject: [PATCH 1/2] [backport of 4.1, because 4.0 autobuild now hits the same problem; when merging just use "ul"] In configure.in, don't remove $AVAILABLE_LANGUAGES_ERRORS_RULES at end because config.status may later need this file (if it does not find it it won't incorporate dependencies of errmsg.sys in sql/share/Makefile). In sql/share/Makefile.am using "all:" leads to double-"all:" in Makefile. configure.in: Don't remove $AVAILABLE_LANGUAGES_ERRORS_RULES at end of configure.in because config.status may later need this file (if it does not find it it won't incorporate dependencies of errmsg.sys in sql/share/Makefile :( ) sql/share/Makefile.am: using "all:" leads to double-"all:" in Makefile (counting the auto-generated); all-local is the standard way to : BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + configure.in | 1 - sql/share/Makefile.am | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 5a34dbbb1d8..967f8c7cb47 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -30,6 +30,7 @@ dellis@goetia.(none) dlenev@brandersnatch.localdomain dlenev@build.mysql.com dlenev@mysql.com +gbichot@production.mysql.com gbichot@quadxeon.mysql.com gerberb@ou800.zenez.com gluh@gluh.(none) diff --git a/configure.in b/configure.in index 8b1b6a99039..938f2f5776f 100644 --- a/configure.in +++ b/configure.in @@ -2720,7 +2720,6 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ]) -rm -f $AVAILABLE_LANGUAGES_ERRORS_RULES echo echo "MySQL has a Web site at http://www.mysql.com/ which carries details on the" echo "latest release, upcoming features, and other information to make your" diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am index 5ca3dce4e04..33c3f9a7edd 100644 --- a/sql/share/Makefile.am +++ b/sql/share/Makefile.am @@ -25,7 +25,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/charsets/README $(distdir)/charsets $(INSTALL_DATA) $(srcdir)/charsets/Index $(distdir)/charsets -all: @AVAILABLE_LANGUAGES_ERRORS@ +all-local: @AVAILABLE_LANGUAGES_ERRORS@ # this is ugly, but portable @AVAILABLE_LANGUAGES_ERRORS_RULES@ From e584559febc18f045b74e1e13e58c88eba92c76a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 7 May 2005 07:50:04 -0700 Subject: [PATCH 2/2] Backport fix for escaping multibyte characters. (Bug #9864) libmysql/libmysql.c: Backport fix for escaping multibyte characters from 4.1 --- libmysql/libmysql.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 47f28e296b2..1e6a54455c4 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3228,6 +3228,23 @@ mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to, from--; continue; } + /* + If the next character appears to begin a multi-byte character, we + escape that first byte of that apparent multi-byte character. (The + character just looks like a multi-byte character -- if it were actually + a multi-byte character, it would have been passed through in the test + above.) + + Without this check, we can create a problem by converting an invalid + multi-byte character into a valid one. For example, 0xbf27 is not + a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) + */ + if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1) + { + *to++= '\\'; + *to++= *from; + continue; + } #endif switch (*from) { case 0: /* Must be escaped for 'mysql' */ @@ -3300,6 +3317,23 @@ mysql_odbc_escape_string(MYSQL *mysql, from--; continue; } + /* + If the next character appears to begin a multi-byte character, we + escape that first byte of that apparent multi-byte character. (The + character just looks like a multi-byte character -- if it were actually + a multi-byte character, it would have been passed through in the test + above.) + + Without this check, we can create a problem by converting an invalid + multi-byte character into a valid one. For example, 0xbf27 is not + a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) + */ + if (use_mb_flag && (l= my_mbcharlen(mysql->charset, *from)) > 1) + { + *to++= '\\'; + *to++= *from; + continue; + } } #endif switch (*from) {