summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorbar@bar.intranet.mysql.r18.ru <>2004-04-06 19:57:33 +0500
committerbar@bar.intranet.mysql.r18.ru <>2004-04-06 19:57:33 +0500
commit950a2ebab1bf8d6988ba2b08d4f7320f02e52d0d (patch)
tree3410735f1e3d76f9c5c170a8f6124e69fdd8422f /sql/protocol.cc
parent0f484ebae601f3c4a02c2eca17c9b9f88d4c5f88 (diff)
downloadmariadb-git-950a2ebab1bf8d6988ba2b08d4f7320f02e52d0d.tar.gz
Fixed charsetnr sent to the client
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 61af6ffceaf..fb4d2a57ab6 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -530,7 +530,10 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
/* Store fixed length fields */
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
- int2store(pos, field.charsetnr);
+ if (item->collation.collation == &my_charset_bin || thd_charset == NULL)
+ int2store(pos, field.charsetnr);
+ else
+ int2store(pos, thd_charset->number);
int4store(pos+2, field.length);
pos[6]= field.type;
int2store(pos+7,field.flags);