diff options
author | unknown <bar@mysql.com> | 2004-12-14 15:58:30 +0400 |
---|---|---|
committer | unknown <bar@mysql.com> | 2004-12-14 15:58:30 +0400 |
commit | cef35aeb1c338743d5bfa4cae46e63486aa2c7c2 (patch) | |
tree | 8c2a5840db77732f2a993807f7fb2844fe58fa03 /sql | |
parent | e05278329e21905a0a43e421a3603114c3edf756 (diff) | |
download | mariadb-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')
-rw-r--r-- | sql/item.h | 2 | ||||
-rw-r--r-- | sql/protocol.cc | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sql/item.h b/sql/item.h index 71b92cd1efc..1024251793e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -765,7 +765,7 @@ class Item_empty_string :public Item_string public: Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_string("",0, cs ? cs : &my_charset_bin) - { name=(char*) header; max_length=length;} + { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } void make_field(Send_field *field); }; 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; |