From c676a4ae0209bb24190c616cc37f68af8d3c91a2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 26 Mar 2010 01:24:49 +0000 Subject: [PATCH] Fixes needed for it to work on PPC. --- mysql-lowercase-bug.patch | 51 +++++++++++++++++++++++++++++++++++++++ mysql.spec | 8 +++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 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); diff --git a/mysql.spec b/mysql.spec index 3ee338d..63c82da 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,6 +1,6 @@ Name: mysql Version: 5.1.45 -Release: 1%{?dist} +Release: 2%{?dist} Summary: MySQL client programs and shared libraries Group: Applications/Databases URL: http://www.mysql.com @@ -42,6 +42,7 @@ Patch10: mysql-strmov.patch Patch12: mysql-cve-2008-7247.patch Patch13: mysql-expired-certs.patch Patch14: mysql-charset-bug.patch +Patch15: mysql-lowercase-bug.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gperf, perl, readline-devel, openssl-devel @@ -180,6 +181,7 @@ the MySQL sources. %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 libtoolize --force aclocal @@ -568,6 +570,10 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Thu Mar 25 2010 Tom Lane 5.1.45-2 +- Fix multiple problems described in upstream bug 52019, because regression + tests fail on PPC if we don't. + * Wed Mar 24 2010 Tom Lane 5.1.45-1 - Update to MySQL 5.1.45, for various fixes described at http://dev.mysql.com/doc/refman/5.1/en/news-5-1-45.html