Skip to content

Skip db name parsing if mts_accessed_dbs == 254 #369

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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pymysqlreplication/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ def _read_status_vars_value_for_key(self, key):
self.host = self.packet.read(host_len)
elif key == Q_UPDATED_DB_NAMES: # 0x0C
mts_accessed_dbs = self.packet.read_uint8()
"""
mts_accessed_dbs < 254:
`mts_accessed_dbs` is equal to the number of dbs
acessed by the query event.
mts_accessed_dbs == 254:
This is the case where the number of dbs accessed
is 1 and the name of the only db is ""
Since no further parsing required(empty name), return.
"""
if mts_accessed_dbs == 254:
return
dbs = []
for i in range(mts_accessed_dbs):
db = self.packet.read_string()
Expand Down