diff options
author | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-07-25 13:50:17 +0500 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-07-25 13:50:17 +0500 |
commit | 39486004bbf13987b5962056bf0bf0ed4bf7b86d (patch) | |
tree | 228b830971937e61b70ac7fa7482b54b81dca165 /libmysqld | |
parent | d6d5983074713a02e59eb02e8ca2c7d747e6e926 (diff) | |
parent | c988ef942fed9688fd2bd126af1e6946bbdd531d (diff) | |
download | mariadb-git-39486004bbf13987b5962056bf0bf0ed4bf7b86d.tar.gz |
Merge mysql.com:/home/hf/work/mysql-4.1.mrg
into mysql.com:/home/hf/work/mysql-5.0.mrg
libmysqld/lib_sql.cc:
Auto merged
tests/mysql_client_test.c:
merging
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; |