Fix for Bug#56138 "valgrind errors about overlapping memory when double-assigning same variable",

and related small fixes.
This commit is contained in:
Guilhem Bichot 2010-11-22 09:57:59 +01:00
commit b5586c67ec
5 changed files with 19 additions and 8 deletions

View file

@ -786,11 +786,8 @@ int field_conv(Field *to,Field *from)
((Field_varstring*)from)->length_bytes ==
((Field_varstring*)to)->length_bytes))
{ // Identical fields
#ifdef HAVE_purify
/* This may happen if one does 'UPDATE ... SET x=x' */
if (to->ptr != from->ptr)
#endif
memcpy(to->ptr,from->ptr,to->pack_length());
// to->ptr==from->ptr may happen if one does 'UPDATE ... SET x=x'
memmove(to->ptr, from->ptr, to->pack_length());
return 0;
}
}