summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2010-11-22 09:57:59 +0100
committerGuilhem Bichot <guilhem@mysql.com>2010-11-22 09:57:59 +0100
commitb5586c67ecd8c163cca793dd039d678fcae1945c (patch)
tree65c9141fa692262975bd2d03b092a1d54a142d97 /sql/field_conv.cc
parent871930e708d6013df36a99da2abc5e9f8787113c (diff)
downloadmariadb-git-b5586c67ecd8c163cca793dd039d678fcae1945c.tar.gz
Fix for Bug#56138 "valgrind errors about overlapping memory when double-assigning same variable",
and related small fixes.
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 0bffde9671a..a4fca6f8ad7 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -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;
}
}