Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix parsing of query field of RowsQueryEvent #602

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

Merged

Conversation

@dongwook-chan
Copy link
Collaborator

@dongwook-chan dongwook-chan commented Jan 23, 2024
edited
Loading

Description

The first byte of payload in RowsQueryEvent must be ignored without being used as the length for the following field query. Yet, the existing code did use this value as length for query and fails whenever parsing query longer than 255 characters which is the maximum value that a single byte can hold.

I fixed the bug referring to code from msql-server.

Other clients in different languages implement the RowsQueryEvent the way mysql-server does and noted below as references.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Other (please specify below)

Checklist

Tests

  • All tests have passed.
  • New tests have been added to cover the changes. (describe below if applicable).

Additional Information

Copy link
Collaborator

@sean-k1 sean-k1 left a comment

Choose a reason for hiding this comment

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

except reivew LGTM

)
self.query_length=self.packet.read_uint8()
self.query = self.packet.read(self.query_length).decode("utf-8")
self.packet.advance(1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about delete line#875

dongwook-chan reacted with thumbs up emoji dongwook-chan reacted with eyes emoji
Copy link
Collaborator

@sean-k1 sean-k1 left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM
except fix lint

Copy link

avaitla commented Feb 29, 2024
edited
Loading

This also crashes for our MySQL 8.035. Would love to see it merged in. We are having to use: poetry add git+ssh://git@github.com:dongwook-chan/python-mysql-replication.git

@sean-k1 sean-k1 merged commit d2ef033 into julien-duponchelle:main Mar 2, 2024
sean-k1 added a commit that referenced this pull request Mar 7, 2024
* Fix parsing of query field of RowsQueryEvent(#602)
* fix log statement for BinLogStreamReader.fetchone(#608)
@sean-k1 sean-k1 mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sean-k1 sean-k1 sean-k1 approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /