This approach assumes that there's always more data to receive if the current packet's payload size is exactly equal to max packet size (16MB) - which is in agreement with specification at https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html. The tests seem to confirm that (when working on the change, I've sprinkled IO.inspects when running the tests to see which recv_packets clauses are called for various payload sizes, including exact multiples of max packet size; also, when adjusting the test to make the payload fix exactly at max packet size, the next successful data fetch returns a payload with size 0).
Closes #10
This approach assumes that there's always more data to receive if the current packet's payload size is exactly equal to max packet size (16MB) - which is in agreement with specification at https://dev.mysql.com/doc/internals/en/sending-more-than-16mbyte.html. The tests seem to confirm that (when working on the change, I've sprinkled IO.inspects when running the tests to see which
recv_packets
clauses are called for various payload sizes, including exact multiples of max packet size; also, when adjusting the test to make the payload fix exactly at max packet size, the next successful data fetch returns a payload with size 0).