From 544d60a817b40f70a2761470831df196599a4152 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 1 Sep 2009 03:35:23 +0000 Subject: [PATCH] Work around unportable assumptions about stpcpy() --- mysql-plugin-bug.patch | 6 +----- mysql-strmov.patch | 26 ++++++++++++++++++++++++++ mysql.spec | 16 +++++++++++----- 3 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 mysql-strmov.patch diff --git a/mysql-plugin-bug.patch b/mysql-plugin-bug.patch index 9432533..8830bc7 100644 --- a/mysql-plugin-bug.patch +++ b/mysql-plugin-bug.patch @@ -6,18 +6,14 @@ http://bugs.mysql.com/bug.php?id=42144 For the moment, just disable this test. -Also, temporarily disable the "mysql" test --- there's something pretty -broken there, but I haven't figured out what yet ... - diff -Naur mysql-5.1.37.orig/mysql-test/t/disabled.def mysql-5.1.37/mysql-test/t/disabled.def --- mysql-5.1.37.orig/mysql-test/t/disabled.def 2009-07-13 19:43:47.000000000 -0400 +++ mysql-5.1.37/mysql-test/t/disabled.def 2009-08-02 20:43:36.000000000 -0400 -@@ -13,4 +13,6 @@ +@@ -13,4 +13,5 @@ innodb_bug39438 : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently" query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically init_connect : Bug#44920 2009-07-06 pcrews MTR not processing master.opt input properly on Windows. *Must be done this way due to the nature of the bug* - +# +plugin_load : gives wrong answer on PPC64 -+mysql : fails for unclear reasons diff --git a/mysql-strmov.patch b/mysql-strmov.patch new file mode 100644 index 0000000..c136f7a --- /dev/null +++ b/mysql-strmov.patch @@ -0,0 +1,26 @@ +Remove overly optimistic definition of strmov() as stpcpy(). + +mysql uses this macro with overlapping source and destination strings, +which is verboten per spec, and fails on some Red Hat platforms. +Deleting the definition is sufficient to make it fall back to a +byte-at-a-time copy loop, which should consistently give the +expected behavior. + + +diff -Naur mysql-5.1.37.orig/include/m_string.h mysql-5.1.37/include/m_string.h +--- mysql-5.1.37.orig/include/m_string.h 2009-07-13 19:08:50.000000000 -0400 ++++ mysql-5.1.37/include/m_string.h 2009-08-31 21:49:49.000000000 -0400 +@@ -81,13 +81,6 @@ + extern void *(*my_str_malloc)(size_t); + extern void (*my_str_free)(void *); + +-#if defined(HAVE_STPCPY) +-#define strmov(A,B) stpcpy((A),(B)) +-#ifndef stpcpy +-extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ +-#endif +-#endif +- + /* Declared in int2str() */ + extern char NEAR _dig_vec_upper[]; + extern char NEAR _dig_vec_lower[]; diff --git a/mysql.spec b/mysql.spec index d554262..8f0b1f4 100644 --- a/mysql.spec +++ b/mysql.spec @@ -1,6 +1,6 @@ Name: mysql Version: 5.1.37 -Release: 4%{?dist} +Release: 5%{?dist} Summary: MySQL client programs and shared libraries Group: Applications/Databases URL: http://www.mysql.com @@ -32,6 +32,7 @@ Patch6: mysql-stack-guard.patch Patch7: mysql-plugin-bug.patch Patch8: mysql-setschedparam.patch Patch9: mysql-ndb-stacksize.patch +Patch10: mysql-strmov.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: gperf, perl, readline-devel, openssl-devel @@ -174,6 +175,7 @@ the MySQL sources. %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 libtoolize --force aclocal @@ -205,13 +207,13 @@ export CFLAGS CXXFLAGS --with-mysqld-user="mysql" \ --with-extra-charsets=all \ --with-big-tables \ - --with-innodb \ - --with-ndbcluster \ + --with-pic \ + --with-plugin-innobase \ + --with-plugin-ndbcluster \ --enable-local-infile \ --enable-largefile \ --enable-thread-safe-client \ - --disable-dependency-tracking \ - --with-named-thread-libs="-lpthread" + --disable-dependency-tracking gcc $CFLAGS $LDFLAGS -o scriptstub "-DLIBDIR=\"%{_libdir}/mysql\"" %{SOURCE4} @@ -640,6 +642,10 @@ fi %{_mandir}/man1/mysql_client_test.1* %changelog +* Mon Aug 31 2009 Tom Lane 5.1.37-5 +- Work around unportable assumptions about stpcpy(); re-enable main.mysql test +- Clean up some obsolete parameters to the configure script + * Sat Aug 29 2009 Tom Lane 5.1.37-4 - Remove one misguided patch; turns out I was chasing a glibc bug - Temporarily disable "main.mysql" test; there's something broken there too,