ganapathi / rpms / mariadb

Forked from rpms/mariadb 4 years ago
Clone

Blame SOURCES/mariadb-strmov.patch

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