Description:
The compressed version of the classic MySQL protocol uses `net_buffer_length`.
This is by default set to 16384.
The result is that a large result set with the compressed protocol results in:
- Compressed Packet 1 of size 16384
- Compressed Packet 2 of size 33679 (varies on the actual resultset)
- Compressed Packet 3 of size 11 (varies)
With a larger `net_buffer_length` the resultset is send in a single packet.
How to repeat:
1. Use MySQL Client with the classic protocol and zlib or zstd enabled.
2. Run something with a large resultset: `SELECT * FROM very_large_table`
3. Observe the number of compressed packets in Wireshark. Especially the size of the first packet.
And then run the same but with a larger `net_buffer_length`.
Suggested fix:
- Add information to the description of `net_buffer_length` on how it affects compression
- Add information to the pages describing compression on how `net_buffer_length` affects this.
- Update the protocol docs to include info about `net_buffer_length`.
- Consider changing how `net_buffer_length` works with compression to avoid sending multiple packets.