field.cc:

  http://bugs.mysql.com/bug.php?id=2218
  updating utf-8 text field generate nonsense chars
  Fix for the above bug.
parent b63b7bff
......@@ -4567,17 +4567,19 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
}
else
{
bool was_conversion;
char buff[80];
String tmpstr(buff,sizeof(buff), &my_charset_bin);
/* Convert character set if nesessary */
if (use_conversion(cs, field_charset))
if ((was_conversion= use_conversion(cs, field_charset)))
{
tmpstr.copy(from, length, cs, field_charset);
from= tmpstr.ptr();
length= tmpstr.length();
}
Field_blob::store_length(length);
if (table->copy_blobs || length <= MAX_FIELD_WIDTH)
if (was_conversion || table->copy_blobs || length <= MAX_FIELD_WIDTH)
{ // Must make a copy
if (from != value.ptr()) // For valgrind
{
......
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