Commit 65d0d45a authored by unknown's avatar unknown

Some USE_MB have been removed.

parent f845e66b
...@@ -805,13 +805,8 @@ String *Item_func_insert::val_str(String *str) ...@@ -805,13 +805,8 @@ String *Item_func_insert::val_str(String *str)
if (args[0]->null_value || args[1]->null_value || args[2]->null_value || if (args[0]->null_value || args[1]->null_value || args[2]->null_value ||
args[3]->null_value) args[3]->null_value)
goto null; /* purecov: inspected */ goto null; /* purecov: inspected */
#ifdef USE_MB start=res->charpos(start);
if (use_mb(res->charset()) && !args[0]->binary()) length=res->charpos(length,start);
{
start=res->charpos(start);
length=res->charpos(length,start);
}
#endif
if (start > res->length()+1) if (start > res->length()+1)
return res; // Wrong param; skip insert return res; // Wrong param; skip insert
if (length > res->length()-start) if (length > res->length()-start)
...@@ -878,10 +873,7 @@ String *Item_func_left::val_str(String *str) ...@@ -878,10 +873,7 @@ String *Item_func_left::val_str(String *str)
return 0; return 0;
if (length <= 0) if (length <= 0)
return &empty_string; return &empty_string;
#ifdef USE_MB length= res->charpos(length);
if (use_mb(res->charset()) && !binary())
length = res->charpos(length);
#endif
if (res->length() > (ulong) length) if (res->length() > (ulong) length)
{ // Safe even if const arg { // Safe even if const arg
if (!res->alloced_length()) if (!res->alloced_length())
...@@ -927,19 +919,11 @@ String *Item_func_right::val_str(String *str) ...@@ -927,19 +919,11 @@ String *Item_func_right::val_str(String *str)
return &empty_string; /* purecov: inspected */ return &empty_string; /* purecov: inspected */
if (res->length() <= (uint) length) if (res->length() <= (uint) length)
return res; /* purecov: inspected */ return res; /* purecov: inspected */
#ifdef USE_MB
if (use_mb(res->charset()) && !binary()) uint start=res->numchars()-(uint) length;
{ if (start<=0) return res;
uint start=res->numchars()-(uint) length; start=res->charpos(start);
if (start<=0) return res; tmp_value.set(*res,start,res->length()-start);
start=res->charpos(start);
tmp_value.set(*res,start,res->length()-start);
}
else
#endif
{
tmp_value.set(*res,(res->length()- (uint) length),(uint) length);
}
return &tmp_value; return &tmp_value;
} }
...@@ -960,13 +944,8 @@ String *Item_func_substr::val_str(String *str) ...@@ -960,13 +944,8 @@ String *Item_func_substr::val_str(String *str)
if ((null_value=(args[0]->null_value || args[1]->null_value || if ((null_value=(args[0]->null_value || args[1]->null_value ||
(arg_count == 3 && args[2]->null_value)))) (arg_count == 3 && args[2]->null_value))))
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
#ifdef USE_MB start=res->charpos(start);
if (use_mb(res->charset()) && !binary()) length=res->charpos(length,start);
{
start=res->charpos(start);
length=res->charpos(length,start);
}
#endif
if (start < 0 || (uint) start+1 > res->length() || length <= 0) if (start < 0 || (uint) start+1 > res->length() || length <= 0)
return &empty_string; return &empty_string;
......
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