summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorholyfoot/hf@mysql.com/deer.(none) <>2006-07-25 13:50:17 +0500
committerholyfoot/hf@mysql.com/deer.(none) <>2006-07-25 13:50:17 +0500
commita9a345d9a59eb0fc04d53e7c86d08e07ca53cc7f (patch)
tree228b830971937e61b70ac7fa7482b54b81dca165 /libmysqld
parente31f8a662c9670955bbc6081f1d73bddc31c786f (diff)
parent95b88445fbf9cbd20efe25972123029ca679b121 (diff)
downloadmariadb-git-a9a345d9a59eb0fc04d53e7c86d08e07ca53cc7f.tar.gz
Merge mysql.com:/home/hf/work/mysql-4.1.mrg
into mysql.com:/home/hf/work/mysql-5.0.mrg
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/lib_sql.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 2640910990e..40966be46a5 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -890,10 +890,14 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
}
else
{
+ uint max_char_len;
/* With conversion */
client_field->charsetnr= thd_cs->number;
- uint char_len= server_field.length / item->collation.collation->mbmaxlen;
- client_field->length= char_len * thd_cs->mbmaxlen;
+ max_char_len= (server_field.type >= (int) MYSQL_TYPE_TINY_BLOB &&
+ server_field.type <= (int) MYSQL_TYPE_BLOB) ?
+ server_field.length / item->collation.collation->mbminlen :
+ server_field.length / item->collation.collation->mbmaxlen;
+ client_field->length= max_char_len * thd_cs->mbmaxlen;
}
client_field->type= server_field.type;
client_field->flags= server_field.flags;