summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 103d82f36aa..c00a7aabe66 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -930,7 +930,7 @@ String *Item_func_trim::val_str(String *str)
char *ptr=(char*) res->ptr();
char *end=ptr+res->length();
const char *r_ptr=remove_str->ptr();
- while (ptr+remove_length < end && !memcmp(ptr,r_ptr,remove_length))
+ while (ptr+remove_length <= end && !memcmp(ptr,r_ptr,remove_length))
ptr+=remove_length;
#ifdef USE_MB
if (use_mb(default_charset_info) && !binary)
@@ -954,7 +954,7 @@ String *Item_func_trim::val_str(String *str)
else
#endif /* USE_MB */
{
- while (ptr + remove_length < end &&
+ while (ptr + remove_length <= end &&
!memcmp(end-remove_length,r_ptr,remove_length))
end-=remove_length;
}