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