summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-12-14 15:58:30 +0400
committerunknown <bar@mysql.com>2004-12-14 15:58:30 +0400
commitcef35aeb1c338743d5bfa4cae46e63486aa2c7c2 (patch)
tree8c2a5840db77732f2a993807f7fb2844fe58fa03 /sql/protocol.cc
parente05278329e21905a0a43e421a3603114c3edf756 (diff)
downloadmariadb-git-cef35aeb1c338743d5bfa4cae46e63486aa2c7c2.tar.gz
bug#6275 "client_test" fail in 4.1.7 make test
bug#6911 resultset metadata always return client character set
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index eaa0fd55b25..95cd8415c85 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -549,10 +549,18 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
if (item->collation.collation == &my_charset_bin || thd_charset == NULL)
+ {
+ /* No conversion */
int2store(pos, field.charsetnr);
+ int4store(pos+2, field.length);
+ }
else
- int2store(pos, thd_charset->number);
- int4store(pos+2, field.length);
+ {
+ /* With conversion */
+ int2store(pos, thd_charset->number);
+ uint char_len= field.length / item->collation.collation->mbmaxlen;
+ int4store(pos+2, char_len * thd_charset->mbmaxlen);
+ }
pos[6]= field.type;
int2store(pos+7,field.flags);
pos[9]= (char) field.decimals;