@@ -126,7 +126,41 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
126
126
127
127
def _dump (self ):
128
128
super ()._dump ()
129
- print ("SQL statement :" , self .sql_statement )
129
+ print ("SQL statement :" , self .sql_statement )
130
+
131
+ class MariadbGtidListEvent (BinLogEvent ):
132
+ """
133
+ GTID List event
134
+ https://mariadb.com/kb/en/gtid_list_event/
135
+
136
+ Attributes:
137
+ gtid_length: Number of GTIDs
138
+ gtid_list: list of 'MariadbGtidObejct'
139
+
140
+ 'MariadbGtidObejct' Attributes:
141
+ domain_id: Replication Domain ID
142
+ server_id: Server_ID
143
+ gtid_seq_no: GTID sequence
144
+ gtid: 'domain_id'+ 'server_id' + 'gtid_seq_no'
145
+ """
146
+ def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
147
+
148
+ super (MariadbGtidListEvent , self ).__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
149
+
150
+ class MariadbGtidObejct (BinLogEvent ):
151
+ """
152
+ Information class of elements in GTID list
153
+ """
154
+ def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
155
+ super (MariadbGtidObejct , self ).__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
156
+ self .domain_id = self .packet .read_uint32 ()
157
+ self .server_id = self .packet .server_id
158
+ self .gtid_seq_no = self .packet .read_uint64 ()
159
+ self .gtid = "%d-%d-%d" % (self .domain_id , self .server_id , self .gtid_seq_no )
160
+
161
+
162
+ self .gtid_length = self .packet .read_uint32 ()
163
+ self .gtid_list = [MariadbGtidObejct (from_packet , event_size , table_map , ctl_connection , ** kwargs ) for i in range (self .gtid_length )]
130
164
131
165
132
166
class RotateEvent (BinLogEvent ):
0 commit comments