Problem reading query results
Posted by: Ken Tozier
Date: January 30, 2011 08:52AM

Hi

I wrote a MySQL connector in Objective-C and have been using it for a couple of years on the same machine as the MySQL database, but recently, I wanted to make it work in situations where the connector and database reside on different machines. What I found, is that replies are broken into chunks which need to be reassembled on the client end.

According to the protocol docs for the packet header (http://tinyurl.com/MySQLPackerHeader) and result packet (http://tinyurl.com/MySQLResultPacket) I should be able to calculate the total size of the query result, but that's not what I'm finding.

For queries that are broken up, the header packet always contains a byte length of 1. I tried making sense of the source for MySQLConnector/C++, but there's an awful lot of code there and I can't find exactly where it reads raw bytes from a socket to see how it reassembles multiple packets into a single result set.

Basically, all I need is a way to calculate how many bytes to expect from the server. Does anyone know how to do this?

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem reading query results
2263
January 30, 2011 08:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.