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

Fix reading json string #99

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Fix reading json string #99

merged 1 commit into from
Oct 11, 2024

Conversation

BearDimonR
Copy link
Contributor

No description provided.

@@ -251,7 +251,7 @@ def read_variable_length_string(self):
length = 0
bits_read = 0
while byte & 0x80 != 0:
byte = struct.pack("!B", self.read(1))
byte = struct.unpack("!B", self.read(1))[0]
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks! Could you add a test for that?

Choose a reason for hiding this comment

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

@long2ice I can confirm this change also worked for me on my system after getting issues with tables with JSON columns.

It's the same implementation that is done in pymysqlreplication project: https://github.com/julien-duponchelle/python-mysql-replication/blob/main/pymysqlreplication/packet.py#L256

@long2ice long2ice merged commit 7c66b1b into long2ice:dev Oct 11, 2024
@long2ice
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants