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

Parse status variables in query event #360

Merged
merged 5 commits into from
Oct 14, 2021
Merged

Parse status variables in query event #360

merged 5 commits into from
Oct 14, 2021

Conversation

dongwook-chan
Copy link
Collaborator

@dongwook-chan dongwook-chan commented Sep 24, 2021

Status variables contain useful information:

  1. List of databases affected by the query
  2. Runtime value of system variables (SQL_MODE, AUTOCOMMIT, CHARSET_SERVER, etc.)
  3. timezone of the master



Users of this library should benefit from new information.
However, if anyone raises performance issues regarding the logic,
this logic can revised to be provided selectively depending on a newly added option.


A status variable in query events is a sequence of status KEY-VALUE pairs.

  1. A KEY is parsed first in pymysqlreplication.event.QueryEvent.__init__().
  2. Respective VALUE is parsed in new method pymysqlreplication.event.QueryEvent._read_status_vars_value_for_key().
  3. This repeats until all KEY-VALUE pairs are exhausted.

Added and passed tests.


For further information please refer to;

@dongwook-chan dongwook-chan changed the title Status vars Parse status variables in query event Sep 24, 2021
@julien-duponchelle
Copy link
Owner

Sorry for the delay will look in details next week

@julien-duponchelle julien-duponchelle merged commit f70f05b into julien-duponchelle:main Oct 14, 2021
@julien-duponchelle
Copy link
Owner

Finnaly got time :D

@julien-duponchelle
Copy link
Owner

Do you have notice a performance issue ? It seem to work fine

@dongwook-chan
Copy link
Collaborator Author

dongwook-chan commented Oct 16, 2021

Nope, I've tested the new feature several times but not yet.
If any issue rises regarding the feature,
I'll add a parameter to BinLogStreamReader.init() so that users could choose whether to use this feature.

I appreciate your kindness to review my PR despite your busy schedule.
I owe you big time.

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.

2 participants