Bug #70211 mysql4.1's eof_packet is break the mysql server/client protocol
Submitted: 2 Sep 2013 7:20 Modified: 10 Dec 2013 16:46
Reporter: jiang xiaobing Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:4.1 OS:Any
Assigned to: CPU Architecture:Any

[2 Sep 2013 7:20] jiang xiaobing
Description:
in mysql4.1, the eof_packet is sended wrong. 

the behavior is different from the internal doc
http://dev.mysql.com/doc/internals/en/generic-response-packets.html#packet-EOF_Packet

in the case, it just send a header (254) , no warning_count and status_flags.

How to repeat:
read the source.

mysql-4.1.22-log/sql $ ack eof_buff
protocol.cc
332:static char eof_buff[1]= { (char) 254 };        /* Marker for end of fields */
382:      VOID(my_net_write(net,eof_buff,1));
404:  return my_net_write(net, eof_buff, 1) || net_flush(net);
638:  my_net_write(&thd->net, eof_buff, 1);

Suggested fix:
the mysql4.1 is end life cycle, will you recieve the patch? 
above mysql4.1, that's ok. because the code is refactored.

BUT, I think this note must be added to the internal doc.
http://dev.mysql.com/doc/internals/en/generic-response-packets.html#packet-EOF_Packet

some native mysql client libraries have this bug when processing eof_packet.

http://code.google.com/p/assql/issues/detail?id=81
https://github.com/go-sql-driver/mysql/pull/114
[2 Sep 2013 7:35] jiang xiaobing
fix category
[2 Sep 2013 7:40] jiang xiaobing
according the source, the wrong eof_packet will be in Protocol::send_fields() and send_old_password_request()
[9 Dec 2013 20:12] Sveta Smirnova
Thank you for the report.

But version 4.1 is not supported. Can you repeat same issue with currently supported versions 5.5 and 5.6?
[10 Dec 2013 2:04] jiang xiaobing
this only affect mysql4.1 as I mentioned above. 

But I think, this should fix in internal doc. because some driver still supports mysql4.1.
[10 Dec 2013 16:46] Sveta Smirnova
Thank you for the feedback.

We can not update list of known bugs in not supported versions at each documentation page where one or another feature is described. So I close this report as "Unsupported".

But thank you for creating this anyway: other people could find this report. You can post a patch and make it public if you want allow other people to use it.