item_strfunc.cc:

  Fix for possible bug when string length is more than 64K
parent 3d555fe3
...@@ -1782,7 +1782,7 @@ String *Item_func_conv_charset::val_str(String *str) ...@@ -1782,7 +1782,7 @@ String *Item_func_conv_charset::val_str(String *str)
int cnvres; int cnvres;
const uchar *s, *se; const uchar *s, *se;
uchar *d, *d0, *de; uchar *d, *d0, *de;
uint dmaxlen; uint32 dmaxlen;
String *arg= args[0]->val_str(str); String *arg= args[0]->val_str(str);
CHARSET_INFO *from,*to; CHARSET_INFO *from,*to;
...@@ -1833,7 +1833,7 @@ outp: ...@@ -1833,7 +1833,7 @@ outp:
break; break;
}; };
str->length((uint) (d-d0)); str->length((uint32) (d-d0));
str->set_charset(to); str->set_charset(to);
return str; return str;
} }
...@@ -1850,7 +1850,7 @@ String *Item_func_conv_charset3::val_str(String *str) ...@@ -1850,7 +1850,7 @@ String *Item_func_conv_charset3::val_str(String *str)
int cnvres; int cnvres;
const uchar *s, *se; const uchar *s, *se;
uchar *d, *d0, *de; uchar *d, *d0, *de;
uint dmaxlen; uint32 dmaxlen;
String *arg= args[0]->val_str(str); String *arg= args[0]->val_str(str);
String *to_cs= args[1]->val_str(str); String *to_cs= args[1]->val_str(str);
String *from_cs= args[2]->val_str(str); String *from_cs= args[2]->val_str(str);
...@@ -1905,7 +1905,7 @@ outp: ...@@ -1905,7 +1905,7 @@ outp:
break; break;
}; };
str->length((uint) (d-d0)); str->length((uint32) (d-d0));
str->set_charset(to_charset); str->set_charset(to_charset);
return str; return str;
} }
......
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