Skip to content

Commit c254f02

Browse files
author
Lior Sion
committed
add support for null event and couple of new usages
nullevent is an event that can happen in the steam but we want to skip it. added two sample events like that: INTVAR_EVENT and GTID_LOG_EVENT - those are events that happen when we do GTID enabled replication, but are of no use (at least not for me at this time) in this packages aspect. It might be when we support moving to a different master seamlessly.
1 parent d70bc3d commit c254f02

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pymysqlreplication/event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,7 @@ def _dump(self):
9999
print("Execution time: %d" % (self.execution_time))
100100
print("Query: %s" % (self.query))
101101

102+
class NullEvent(BinLogEvent):
103+
def __init__(self, from_packet, event_size, table_map, ctl_connection, log_persistancer = None):
104+
super(NullEvent, self).__init__(from_packet, event_size, table_map, ctl_connection, log_persistancer)
105+
self.packet.advance(event_size)

pymysqlreplication/packet.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class BinLogPacketWrapper(object):
3434
TABLE_MAP_EVENT: TableMapEvent,
3535
ROTATE_EVENT: RotateEvent,
3636
FORMAT_DESCRIPTION_EVENT: FormatDescriptionEvent,
37-
XID_EVENT: XidEvent
37+
XID_EVENT: XidEvent,
38+
INTVAR_EVENT: NullEvent,
39+
GTID_LOG_EVENT: NullEvent
3840
}
3941

4042
def __init__(self, from_packet, table_map, ctl_connection):

0 commit comments

Comments
 (0)