From 17b4e3ed9661cb7b8d55128254ad76509e0b2abc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jun 2002 14:46:50 +0500 Subject: [PATCH] Fixed charset problem on UPDATE in non-default-charset field --- sql/field_conv.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 3b6de1383e2..3b8a2ee791c 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -520,7 +520,9 @@ void field_conv(Field *to,Field *from) char buff[MAX_FIELD_WIDTH]; String result(buff,sizeof(buff),default_charset_info); from->val_str(&result,&result); - to->store(result.c_ptr_quick(),result.length(),default_charset_info); + to->store(result.c_ptr_quick(),result.length(), + to->binary()?default_charset_info:((Field_str*)to)->charset()); + // QQ: what to do if "from" and "to" are of dirrent charsets? } else if (from->result_type() == REAL_RESULT) to->store(from->val_real());