Skip to content

Commit 1c0f618

Browse files
author
jasonz
committed
add support for Stop Event
1 parent 7a5dc24 commit 1c0f618

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

pymysqlreplication/binlogstream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
from pymysql.util import int2byte
1111

1212
from .packet import BinLogPacketWrapper
13-
from .constants.BINLOG import TABLE_MAP_EVENT, ROTATE_EVENT
13+
from .constants.BINLOG import TABLE_MAP_EVENT, ROTATE_EVENT, STOP_EVENT
1414
from .gtid import GtidSet
1515
from .event import (
1616
QueryEvent, RotateEvent, FormatDescriptionEvent,
17-
XidEvent, GtidEvent, NotImplementedEvent)
17+
XidEvent, GtidEvent, StopEvent, NotImplementedEvent)
1818
from .row_event import (
1919
UpdateRowsEvent, WriteRowsEvent, DeleteRowsEvent, TableMapEvent)
2020

@@ -359,6 +359,7 @@ def _allowed_event_list(self, only_events, ignored_events,
359359
events = set((
360360
QueryEvent,
361361
RotateEvent,
362+
StopEvent,
362363
FormatDescriptionEvent,
363364
XidEvent,
364365
GtidEvent,

pymysqlreplication/event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ class FormatDescriptionEvent(BinLogEvent):
123123
pass
124124

125125

126+
class StopEvent(BinLogEvent):
127+
pass
128+
129+
126130
class XidEvent(BinLogEvent):
127131
"""A COMMIT event
128132

pymysqlreplication/packet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BinLogPacketWrapper(object):
3333
constants.XID_EVENT: event.XidEvent,
3434
constants.INTVAR_EVENT: event.NotImplementedEvent,
3535
constants.GTID_LOG_EVENT: event.GtidEvent,
36-
constants.STOP_EVENT: event.NotImplementedEvent,
36+
constants.STOP_EVENT: event.StopEvent,
3737
# row_event
3838
constants.UPDATE_ROWS_EVENT_V1: row_event.UpdateRowsEvent,
3939
constants.WRITE_ROWS_EVENT_V1: row_event.WriteRowsEvent,

0 commit comments

Comments
 (0)