summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-12-16 21:02:21 +0300
committerAlexander Nozdrin <alik@sun.com>2009-12-16 21:02:21 +0300
commit09942fe8e89778e8b9ab99a8f0aa941a7fc95b16 (patch)
treec656767fe54a976ffb669926348b9fac198be312 /sql/item_timefunc.cc
parentf0ae3168a3f2b16fd0718ca4b93533293c5deea8 (diff)
parentefe619585840b27ef156b35f2be6ef3c9809d2e5 (diff)
downloadmariadb-git-09942fe8e89778e8b9ab99a8f0aa941a7fc95b16.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - include/my_no_pthread.h - mysql-test/r/sp-ucs2.result - sql/log.cc - sql/sql_acl.cc - sql/sql_yacc.yy
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 56c46efb1a8..392bc936f17 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2609,9 +2609,9 @@ void Item_char_typecast::fix_length_and_dec()
from_cs != &my_charset_bin &&
cast_cs != &my_charset_bin);
collation.set(cast_cs, DERIVATION_IMPLICIT);
- char_length= (cast_length >= 0) ?
- cast_length :
- args[0]->max_length / args[0]->collation.collation->mbmaxlen;
+ char_length= (cast_length >= 0) ? cast_length :
+ args[0]->max_length /
+ (cast_cs == &my_charset_bin ? 1 : args[0]->collation.collation->mbmaxlen);
max_length= char_length * cast_cs->mbmaxlen;
}