Commit 4239d4b2 authored by unknown's avatar unknown

item_strfunc.cc:

  Unnesessary copying was fixed


sql/item_strfunc.cc:
  Unnesessary copying was fixed
parent 484cf319
......@@ -975,16 +975,10 @@ String *Item_func_right::val_str(String *str)
if (res->length() <= (uint) length)
return res; /* purecov: inspected */
/*
As far "res" contains at least "length" bytes
(according to the above condition and return),
the below statement is safe. res->numchars() can
never return a value more than "length".
*/
uint start=res->numchars()-(uint) length;
if (!start)
uint start=res->numchars();
if (start <= (uint) length)
return res;
start=res->charpos(start);
start=res->charpos(start - (uint) length);
tmp_value.set(*res,start,res->length()-start);
return &tmp_value;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment