From b24232dd15a8d736afe4c03159b070c22a00e655 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 9 May 2010 11:05:53 +0200 Subject: Import mysql-5.1.46-1 --- mysql-lowercase-bug.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 mysql-lowercase-bug.patch (limited to 'mysql-lowercase-bug.patch') diff --git a/mysql-lowercase-bug.patch b/mysql-lowercase-bug.patch new file mode 100644 index 0000000..4387838 --- /dev/null +++ b/mysql-lowercase-bug.patch @@ -0,0 +1,51 @@ +Fix multiple coding errors related to upstream bug #52019. + + +diff -Naur mysql-5.1.45.orig/client/mysqltest.cc mysql-5.1.45/client/mysqltest.cc +--- mysql-5.1.45.orig/client/mysqltest.cc 2010-03-01 14:30:46.000000000 -0500 ++++ mysql-5.1.45/client/mysqltest.cc 2010-03-25 19:46:36.000000000 -0400 +@@ -5586,7 +5586,7 @@ + /* Could be a multibyte character */ + /* This code is based on the code in "sql_load.cc" */ + #ifdef USE_MB +- int charlen = my_mbcharlen(charset_info, c); ++ int charlen = my_mbcharlen(charset_info, (unsigned char) c); + /* We give up if multibyte character is started but not */ + /* completed before we pass buf_end */ + if ((charlen > 1) && (p + charlen) <= buf_end) +@@ -5598,16 +5598,16 @@ + + for (i= 1; i < charlen; i++) + { ++ c= my_getc(cur_file->file); + if (feof(cur_file->file)) + goto found_eof; +- c= my_getc(cur_file->file); + *p++ = c; + } + if (! my_ismbchar(charset_info, mb_start, p)) + { + /* It was not a multiline char, push back the characters */ + /* We leave first 'c', i.e. pretend it was a normal char */ +- while (p > mb_start) ++ while (p > mb_start+1) + my_ungetc(*--p); + } + } +@@ -9642,6 +9642,8 @@ + void replace_dynstr_append_mem(DYNAMIC_STRING *ds, + const char *val, int len) + { ++ char lower[512]; ++ + #ifdef __WIN__ + fix_win_paths(val, len); + #endif +@@ -9649,7 +9651,6 @@ + if (display_result_lower) + { + /* Convert to lower case, and do this first */ +- char lower[512]; + char *c= lower; + for (const char *v= val; *v; v++) + *c++= my_tolower(charset_info, *v); -- cgit