Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left pad odd length hex strings #1891

Merged
merged 2 commits into from Jul 25, 2023
Merged

Conversation

adjeiv
Copy link
Contributor

@adjeiv adjeiv commented Jul 24, 2023

Fixes dolthub/dolt#6351
If hex string v is of odd length, prepend an "0" before passing it to Go's DecodeString.
I've changed the implementation to use DecodeString, but if keeping this as a byte array is preferred, I'll switch back.

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution @adjeiv! 🙏 Your fix looks really great.

Could you please add a really quick query test (e.g. select 0x12345) to this file:

var QueryTests = []QueryTest{

After that, this looks good to merge!

(I see there's one CI check that's failing for import ordering, but it doesn't seem related, since your changes didn't touch the imports, so don't worry about that one.)

Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect! Thank you so much @adjeiv! 🙏

Let us know if there's anything we can do to help you in your use of go-mysql-server and Dolt!

@fulghum fulghum merged commit 801d324 into dolthub:main Jul 25, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Left pad hex literals that aren't even lengths
3 participants