List:Internals« Previous MessageNext Message »
From:Eric Day Date:December 14 2009 6:18pm
Subject:Re: mysql client packet header
View as plain text  
Hi Eric,

The result is made up of multiple packets, and the first packet is
the number of columns. For example, if you see:

01 00 00 01 0d

The packet is 1 byte long, has a packet number of 1 (first packet in
response), and the payload of the packet is 0d, or 13, which represents
the number of columns in this particular result set. You then get a
number of packets for each column header information and row.

-Eric

On Mon, Dec 14, 2009 at 09:48:51AM -0800, Eric DeFriez wrote:
> according to:
> http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol#The_Packet_Header
> 
> the first 3 bytes of the response from server to client is the length
> of the mysql packet, however from my own investigations (mysql 5.0.37
> with innodb) the response packet to any query ("select ...") is always
> hex "01 00 00" regardless of the length of the mysql response packet.
> :-/
> 
> some executions (like "use <database>" or "set autocommit=0") do get
> mysql to return a legitimate length ("07 00 00") however any query i
> execute where i expect data rows to be returned the length is never
> correct.
> 
> anyone know what the problem is?
> 
> thanks,
> eric
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals?unsub=1
Thread
mysql client packet headerEric DeFriez14 Dec
  • Re: mysql client packet headerEric Day14 Dec
    • Re: mysql client packet headerEric DeFriez15 Dec
      • 5.4 Build errorHiromichi Watari15 Dec