summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-07-25 13:50:17 +0500
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-07-25 13:50:17 +0500
commit39486004bbf13987b5962056bf0bf0ed4bf7b86d (patch)
tree228b830971937e61b70ac7fa7482b54b81dca165
parentd6d5983074713a02e59eb02e8ca2c7d747e6e926 (diff)
parentc988ef942fed9688fd2bd126af1e6946bbdd531d (diff)
downloadmariadb-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
-rw-r--r--libmysqld/lib_sql.cc8
-rw-r--r--tests/mysql_client_test.c2
2 files changed, 8 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;
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index b81c0aef506..76a220e2454 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -15291,7 +15291,9 @@ static struct my_tests_st my_tests[]= {
{ "test_bug14845", test_bug14845 },
{ "test_bug15510", test_bug15510 },
{ "test_opt_reconnect", test_opt_reconnect },
+#ifndef EMBEDDED_LIBRARY
{ "test_bug12744", test_bug12744 },
+#endif
{ "test_bug16143", test_bug16143 },
{ "test_bug15613", test_bug15613 },
{ "test_bug20152", test_bug20152 },