summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorunknown <holyfoot@deer.(none)>2006-06-02 22:33:22 +0500
committerunknown <holyfoot@deer.(none)>2006-06-02 22:33:22 +0500
commita1da97ff5e08b77dcfbb8e2479eccd094c1e71a2 (patch)
treed9e99d11138f27e884a4890713ab580a667e2249 /libmysqld
parent3d590258de22fe3ced796c515daceeb9f3ead6ab (diff)
downloadmariadb-git-a1da97ff5e08b77dcfbb8e2479eccd094c1e71a2.tar.gz
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
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 bf8c17a71af..04d622544a3 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -665,10 +665,14 @@ bool Protocol::send_fields(List<Item> *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;