summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2018-09-20 06:13:43 +0300
committerMichael Widenius <monty@mariadb.org>2018-10-05 14:25:40 +0300
commit6c97e85673602199f51dd4bbcb1cf93cbf47ffc9 (patch)
tree491cb05694964c0fb665bc0b12ed449ad22adba6 /sql/item_strfunc.cc
parent29703e4f876d09eb0532c2089cf176a038f5fae5 (diff)
downloadmariadb-git-6c97e85673602199f51dd4bbcb1cf93cbf47ffc9.tar.gz
Remove valgrind warnings from Item_str_concat
This warning come from a copy() operation of type: memcpy(ptr, ptr+A, B), which is safe but produces a warning when run with valgrind. To avoid the warning, I added copy_or_move() method which uses memmove() instead of memcpy(). In 10.3 the change in item_strfunc::Item_func_concat() has to be mirroed in Item_func_concat_oracle() to avoid future valgrind warnings.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index e332f034fb3..57a1e7ec55b 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -603,7 +603,7 @@ String *Item_func_concat::val_str(String *str)
goto null;
if (res != str)
- str->copy(res->ptr(), res->length(), res->charset());
+ str->copy_or_move(res->ptr(), res->length(), res->charset());
for (uint i= 1 ; i < arg_count ; i++)
{