elixir-ecto / myxql

MySQL 5.5+ driver for Elixir
Apache License 2.0
273 stars 67 forks source link

Support receiving packets larger than 16MB #105

Closed zoldar closed 4 years ago

zoldar commented 4 years ago

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).

wojtekmach commented 4 years ago

Wonderful, thank you so much!