Blame SOURCES/mariadb-strmov.patch

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