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

Skip db name parsing if mts_accessed_dbs == 254 #369

Merged

Conversation

dongwook-chan
Copy link
Collaborator

@dongwook-chan dongwook-chan commented Mar 9, 2022

This PR is a fix for PR#360(released in 0.27)

I interpreted mts_accessed_dbs as db count in PR#360 .
However after reproducing kvitek's crash in Issue#278,
I did some more research how the variable is set:

https://github.com/mysql/mysql-server/blob/6846e6b2f72931991cc9fd589dc9946ea2ab58c9/sql/log_event.cc#L3598-L3602

(log_event.h /log_event.cc is responsible for writing low-level binlog,
according to
https://dev.mysql.com/doc/internals/en/source-files-related-to-the-binary-log.html)

Turns out that if the value of the variables equals 254,
the variable is no longer interpreted as the db count,
but represent a following case:

  1. db count equals 1
  2. The name of the only db is ""(blank).

Therefore, I edited event.py so that after the value 254 is encountered,
no further parsing is done regarding db names. ("" doesn't need to be parsed)

So far I have reproduced the issue for BeginEvent.
However, I have not yet figured out to incorporate into unittest.
I will add tests ASAP.

I interpreted `mts_accessed_dbs` as db count in PR#360 (released in 0.27).
However after reproducing kvitek's exception in Issue#278,
I did some more research how it is set:
https://github.com/mysql/mysql-server/blob/6846e6b2f72931991cc9fd589dc9946ea2ab58c9/sql/log_event.cc#L3598-L3602
(log_event.h /log_event.cc is responsible for writing low-level binlog,
according to
https://dev.mysql.com/doc/internals/en/source-files-related-to-the-binary-log.html)

Turns out that if the value of the variables equals 254,
the variable is no longer interpreted as the db count,
but represent a following case:
1. db count equals 1
2. The name of the only db is blank.

Therefore, I edited event.py so that after the value 254 is encountered,
no further parsing is done regarding db names.

So far I have reproduced the issue for `BeginEvent`.
However, I have not yet figured out to incorporate into unittest.
I will add tests ASAP.
@the4thdoctor
Copy link

@julien-duponchelle any chance to get this merged? ta!

@julien-duponchelle julien-duponchelle merged commit c2b8f35 into julien-duponchelle:main Apr 8, 2022
@julien-duponchelle
Copy link
Owner

I'm going to ship a release

@dongwook-chan
Copy link
Collaborator Author

@julien-duponchelle
Thank you so much.

@the4thdoctor
Could you please leave a reply if this release solves your issue?

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