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