List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:June 18 2001 2:40pm
Subject:Is libmysqld/lib_vio.c:vio_read() supposed to work?
View as plain text  
Hi!

>>>>> "John" == John Birrell <jb@stripped> writes:

John> I think that the embedded server vio_read() code is
John> over-running the end of the buffered packets. It needs
John> to do something to limit the read request size like:

John> if (vio->where_in_packet + size > vio->end_of_packet)
John>   {
John>   size = vio->end_of_packet - vio->where_in_packet;
John>   }

Tim, could you check this out (I don't have a test case to test this)

The if is right, but there should not be a need to readjust size
John, any change of getting me a test case for this?

John> I'm unsure if it supposed to go on to the next buffered
John> packet, or just return a smaller number of bytes.

<cut>

John> I patched my local source with the code above and
John> it fixes the "Packets out of order" error, allowing
John> correct number of rows to be fetched. I'm not sure
John> how this code is supposed to behave, though.

The current idea is as follows (we will probably optimize this later)

- Each packet will be allocated separately
  (To do this with 'alloc_root' gives very little overhead)

- On write, we are always writing a full packet.

- When reading, we will do two reads for each packet;  First read the length
  and then read the data.

Regards,
Monty
Thread
Is libmysqld/lib_vio.c:vio_read() supposed to work?John Birrell17 Jun
  • Is libmysqld/lib_vio.c:vio_read() supposed to work?Michael Widenius18 Jun
    • Re: Is libmysqld/lib_vio.c:vio_read() supposed to work?John Birrell19 Jun
      • Re: Is libmysqld/lib_vio.c:vio_read() supposed to work?Michael Widenius19 Jun
        • Re: Is libmysqld/lib_vio.c:vio_read() supposed to work?John Birrell19 Jun