diff options
author | bar@mysql.com <> | 2004-12-14 15:58:30 +0400 |
---|---|---|
committer | bar@mysql.com <> | 2004-12-14 15:58:30 +0400 |
commit | 4fa867494dec481ed38ea3a8cce529c5f02783bb (patch) | |
tree | 8c2a5840db77732f2a993807f7fb2844fe58fa03 /sql/protocol.cc | |
parent | 94b3e06dd6dc258602b571c8b9803fce443c638d (diff) | |
download | mariadb-git-4fa867494dec481ed38ea3a8cce529c5f02783bb.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.cc | 12 |
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; |