From 1d1616dee3d76ef31f01bd4423ceff3831ce855b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Dec 2010 08:25:37 +0100 Subject: more work on MySQL 5.5.8 --- mysql-strmov.patch | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 mysql-strmov.patch (limited to 'mysql-strmov.patch') diff --git a/mysql-strmov.patch b/mysql-strmov.patch new file mode 100644 index 0000000..07e5914 --- /dev/null +++ b/mysql-strmov.patch @@ -0,0 +1,32 @@ +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. + +Note: the particular case that prompted this patch is reported and fixed +at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's +ability to detect this type of error is low, and I also see little evidence +of any real performance gain from optimizing these calls. So I'm keeping +this patch. + + +--- mysql-5.1.54/include/m_string.h.orig 2010-11-29 11:38:01.000000000 +0100 ++++ mysql-5.1.54/include/m_string.h 2010-12-16 17:52:57.914976701 +0100 +@@ -73,14 +73,6 @@ + extern void *(*my_str_malloc)(size_t); + extern void (*my_str_free)(void *); + +-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) +-#define strmov(A,B) __builtin_stpcpy((A),(B)) +-#elif 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[]; -- cgit