From 58c64aea924555e1c9f01fcf370ef1dd3f8cdca3 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Wed, 12 Oct 2005 18:50:25 +0500 Subject: [PATCH 1/2] memcpy_overlap() removed, as 1. it's wrong to use memcpy() for overlapped areas; 2. we use it only once. During merge to 4.1 will remove a memcpy_overlap() call from strings/ctype-tis620.c as well in order to fix bug #10836: ctype_tis620 test failure with ICC-compiled binaries on IA64. --- include/m_string.h | 10 ---------- myisam/mi_search.c | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/include/m_string.h b/include/m_string.h index 419e70d93bf..f081c966fac 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -119,16 +119,6 @@ extern void bmove_allign(gptr dst,const gptr src,uint len); #define bmove512(A,B,C) memcpy(A,B,C) #endif -#ifdef HAVE_purify -#include -#define memcpy_overlap(A,B,C) \ -DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \ -bmove((byte*) key,(byte*) from,(size_t) length); -#else -#define memcpy_overlap(A,B,C) memcpy((A), (B), (C)) -#endif /* HAVE_purify */ - - /* Prototypes for string functions */ #if !defined(bfill) && !defined(HAVE_BFILL) diff --git a/myisam/mi_search.c b/myisam/mi_search.c index c0be1a427df..3d16a70d70b 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -1306,7 +1306,7 @@ uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, } DBUG_PRINT("info",("key: %p from: %p length: %u", key, from, length)); - memcpy_overlap((byte*) key, (byte*) from, (size_t) length); + memmove((byte*) key, (byte*) from, (size_t) length); key+=length; from+=length; } From 8682dffc68911d35382649866b7cfb1bc095bf96 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Thu, 13 Oct 2005 13:25:07 +0500 Subject: [PATCH 2/2] memcpy_overlap() replaced with memmove() during the merging. --- strings/ctype-tis620.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index dcb0e0525b4..35cf10f1bcc 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -498,7 +498,7 @@ static uint thai2sortable(uchar *tstr, uint len) l2bias use to control position weight of l2char example (*=l2char) XX*X must come before X*XX */ - memcpy_overlap((char*) p, (char*) (p+1), tlen-1); + memmove((char*) p, (char*) (p+1), tlen-1); tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1; p--; continue;