Don't confuse length encoded int with EOF #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.