9a3713b
Remove overly optimistic definition of strmov() as stpcpy().
9a3713b
9a3713b
mysql uses this macro with overlapping source and destination strings,
9a3713b
which is verboten per spec, and fails on some Red Hat platforms.
9a3713b
Deleting the definition is sufficient to make it fall back to a
9a3713b
byte-at-a-time copy loop, which should consistently give the
9a3713b
expected behavior.
9a3713b
9a3713b
Note: the particular case that prompted this patch is reported and fixed
9a3713b
at http://bugs.mysql.com/bug.php?id=48864.  However, my faith in upstream's
9a3713b
ability to detect this type of error is low, and I also see little evidence
9a3713b
of any real performance gain from optimizing these calls.  So I'm keeping
9a3713b
this patch.
9a3713b
9a3713b
9a3713b
diff -up mysql-5.6.10/include/m_string.h.orig mysql-5.6.10/include/m_string.h
9a3713b
--- mysql-5.6.10/include/m_string.h.orig	2013-01-22 17:54:49.000000000 +0100
9a3713b
+++ mysql-5.6.10/include/m_string.h	2013-02-19 14:12:58.866241727 +0100
9a3713b
@@ -65,15 +65,6 @@ extern void *(*my_str_malloc)(size_t);
9a3713b
 extern void *(*my_str_realloc)(void *, size_t);
9a3713b
 extern void (*my_str_free)(void *);
9a3713b
 
9a3713b
-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
9a3713b
-#define strmov(A,B) __builtin_stpcpy((A),(B))
9a3713b
-#elif defined(HAVE_STPCPY)
9a3713b
-#define strmov(A,B) stpcpy((A),(B))
9a3713b
-#ifndef stpcpy
9a3713b
-extern char *stpcpy(char *, const char *);	/* For AIX with gcc 2.95.3 */
9a3713b
-#endif
9a3713b
-#endif
9a3713b
-
9a3713b
 /* Declared in int2str() */
9a3713b
 extern char _dig_vec_upper[];
9a3713b
 extern char _dig_vec_lower[];