From ea7aa193960d42c0bdbc011ba3714ceebc6f189c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Jun 2006 22:33:22 +0500 Subject: bug #19983 (mysql_client_test_embedded fails) libmysqld/lib_sql.cc: field length counting fixed tests/mysql_client_test.c: this test is not for embedded server as it tests kill command --- libmysqld/lib_sql.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libmysqld') diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index bf8c17a71af..04d622544a3 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -665,10 +665,14 @@ bool Protocol::send_fields(List *list, uint flag) } 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; -- cgit v1.2.1