Commit 52ba265b authored by unknown's avatar unknown

Fixesd that wrong charset were used

parent 76949bf9
...@@ -775,7 +775,7 @@ int Item::save_in_field(Field *field) ...@@ -775,7 +775,7 @@ int Item::save_in_field(Field *field)
field->result_type() == STRING_RESULT) field->result_type() == STRING_RESULT)
{ {
String *result; String *result;
CHARSET_INFO *cs=field->charset(); CHARSET_INFO *cs=charset();
char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns
str_value.set_quick(buff,sizeof(buff),cs); str_value.set_quick(buff,sizeof(buff),cs);
result=val_str(&str_value); result=val_str(&str_value);
...@@ -807,12 +807,11 @@ int Item::save_in_field(Field *field) ...@@ -807,12 +807,11 @@ int Item::save_in_field(Field *field)
int Item_string::save_in_field(Field *field) int Item_string::save_in_field(Field *field)
{ {
String *result; String *result;
CHARSET_INFO *cs=field->charset();
result=val_str(&str_value); result=val_str(&str_value);
if (null_value) if (null_value)
return set_field_to_null(field); return set_field_to_null(field);
field->set_notnull(); field->set_notnull();
return (field->store(result->ptr(),result->length(),cs)) ? -1 : 0; return (field->store(result->ptr(),result->length(),charset())) ? -1 : 0;
} }
int Item_int::save_in_field(Field *field) int Item_int::save_in_field(Field *field)
...@@ -880,11 +879,10 @@ longlong Item_varbinary::val_int() ...@@ -880,11 +879,10 @@ longlong Item_varbinary::val_int()
int Item_varbinary::save_in_field(Field *field) int Item_varbinary::save_in_field(Field *field)
{ {
int error; int error;
CHARSET_INFO *cs=field->charset();
field->set_notnull(); field->set_notnull();
if (field->result_type() == STRING_RESULT) if (field->result_type() == STRING_RESULT)
{ {
error=field->store(str_value.ptr(),str_value.length(),cs); error=field->store(str_value.ptr(),str_value.length(),charset());
} }
else else
{ {
......
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