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

Made QueryEvent decode options class variables #296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion pymysqlreplication/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ def _dump(self):


class QueryEvent(BinLogEvent):
charset = 'utf-8'
on_errors = 'strict'
'''This evenement is trigger when a query is run of the database.
Only replicated queries are logged.'''
def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs):
Expand All @@ -174,7 +176,8 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
self.packet.advance(1)

self.query = self.packet.read(event_size - 13 - self.status_vars_length
- self.schema_length - 1).decode("utf-8")
- self.schema_length - 1).decode(
encoding=self.charset, errors=self.on_errors)
#string[EOF] query

def _dump(self):
Expand Down