summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorbar@gw.udmsearch.izhnet.ru <>2002-06-21 14:46:50 +0500
committerbar@gw.udmsearch.izhnet.ru <>2002-06-21 14:46:50 +0500
commitd616c90188f2c9903b6790720cd6172cbdada7dd (patch)
treecb8b0f04282a8a4b8aaf26c2e3284e91cdf3af98 /sql/field_conv.cc
parentc5b8f48cf5acecb4f50155a98bf83f4eefd53484 (diff)
downloadmariadb-git-d616c90188f2c9903b6790720cd6172cbdada7dd.tar.gz
Fixed charset problem on UPDATE in non-default-charset field
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc4
1 files changed, 3 insertions, 1 deletions
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());