rows are sent as a series of length encoded strings. These are strings prefixed by a length encoded integer, where 0xFE is the prefix byte for an 8 byte integer.
After all the rows are sent, we get a OK/EOF packet beginning with 0xFE.
The way to tell the OK/EOF apart from an 8-byte length-encoded int is by checking that the length of the whole payload is < 9 (i.e. there isn't enough room for an 8-byte int).
We were doing the < 9 check for the deprecated EOF packets, but not for the newer OK packets.
Prior to this commit a row starting with a field with length 2 ** 24 or higher would get interpreted as an EOF and we'd fail with:
rows are sent as a series of length encoded strings. These are strings prefixed by a length encoded integer, where 0xFE is the prefix byte for an 8 byte integer.
After all the rows are sent, we get a OK/EOF packet beginning with 0xFE.
The way to tell the OK/EOF apart from an 8-byte length-encoded int is by checking that the length of the whole payload is < 9 (i.e. there isn't enough room for an 8-byte int).
We were doing the
< 9
check for the deprecated EOF packets, but not for the newer OK packets.