summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <bar@bar.intranet.mysql.r18.ru>2004-02-06 16:59:25 +0400
committerunknown <bar@bar.intranet.mysql.r18.ru>2004-02-06 16:59:25 +0400
commitfaa8a41b1db57e643617eda8c49803f6e1287f87 (patch)
tree1de54a5d40a817616ee8991ff03ebb355c4f1d18 /sql/item_timefunc.cc
parente5ab70702c082c77401052f940b18b5f6d50a8c3 (diff)
downloadmariadb-git-faa8a41b1db57e643617eda8c49803f6e1287f87.tar.gz
Problem fix:
http://bugs.mysql.com/bug.php?id=2366 Wrong utf8 behaviour when data is trancated
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index ed5b9ecc0db..062e7fc7b44 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1286,12 +1286,13 @@ void Item_func_date_format::fix_length_and_dec()
if (args[1]->type() == STRING_ITEM)
{ // Optimize the normal case
fixed_length=1;
- max_length=format_length(((Item_string*) args[1])->const_string());
+ max_length= format_length(((Item_string*) args[1])->const_string())*
+ collation.collation->mbmaxlen;
}
else
{
fixed_length=0;
- max_length=args[1]->max_length*10;
+ max_length=args[1]->max_length*10*collation.collation->mbmaxlen;
set_if_smaller(max_length,MAX_BLOB_WIDTH);
}
maybe_null=1; // If wrong date