Blame SOURCES/mariadb-strmov.patch

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