-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't confuse length encoded int with EOF
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: ``` Trilogy::QueryError: trilogy_read_row: TRILOGY_EXTRA_DATA_IN_PACKET ``` 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 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.
- Loading branch information
1 parent
f199c58
commit 8ea052e
Showing
3 changed files
with
46 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters