Skip to content

Commit

Permalink
added fix for non utf8 query event
Browse files Browse the repository at this point in the history
  • Loading branch information
mastak committed Jul 13, 2016
1 parent f175d2b commit 3fd7f38
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pymysqlreplication/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ 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)

try:
self.query = self.query.decode("utf-8")
except UnicodeDecodeError:
self.query = self.query.decode("latin-1")
#string[EOF] query

def _dump(self):
Expand Down

0 comments on commit 3fd7f38

Please sign in to comment.