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
commitea7aa193960d42c0bdbc011ba3714ceebc6f189c (patch)
treed9e99d11138f27e884a4890713ab580a667e2249 /libmysqld
parentddd9fbacc61315812b4ac5f07eb4f1bd69e9811c (diff)
downloadmariadb-git-ea7aa193960d42c0bdbc011ba3714ceebc6f189c.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;