diff options
author | holyfoot/hf@mysql.com/deer.(none) <> | 2006-07-25 13:50:17 +0500 |
---|---|---|
committer | holyfoot/hf@mysql.com/deer.(none) <> | 2006-07-25 13:50:17 +0500 |
commit | a9a345d9a59eb0fc04d53e7c86d08e07ca53cc7f (patch) | |
tree | 228b830971937e61b70ac7fa7482b54b81dca165 /libmysqld | |
parent | e31f8a662c9670955bbc6081f1d73bddc31c786f (diff) | |
parent | 95b88445fbf9cbd20efe25972123029ca679b121 (diff) | |
download | mariadb-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.cc | 8 |
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; |