@@ -56,7 +56,7 @@ class GtidEvent(BinLogEvent):
56
56
"""GTID change in binlog event
57
57
"""
58
58
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
59
- super (GtidEvent , self ).__init__ (from_packet , event_size , table_map ,
59
+ super ().__init__ (from_packet , event_size , table_map ,
60
60
ctl_connection , ** kwargs )
61
61
62
62
self .commit_flag = struct .unpack ("!B" , self .packet .read (1 ))[0 ] == 1
@@ -97,7 +97,7 @@ class MariadbGtidEvent(BinLogEvent):
97
97
"""
98
98
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
99
99
100
- super (MariadbGtidEvent , self ).__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
100
+ super ().__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
101
101
102
102
self .server_id = self .packet .server_id
103
103
self .gtid_seq_no = self .packet .read_uint64 ()
@@ -106,7 +106,7 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
106
106
self .gtid = "%d-%d-%d" % (self .domain_id , self .server_id , self .gtid_seq_no )
107
107
108
108
def _dump (self ):
109
- super (MariadbGtidEvent , self )._dump ()
109
+ super ()._dump ()
110
110
print ("Flags:" , self .flags )
111
111
print ('GTID:' , self .gtid )
112
112
@@ -121,11 +121,11 @@ class MariadbAnnotateRowsEvent(BinLogEvent):
121
121
sql_statement: The SQL statement
122
122
"""
123
123
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
124
- super (MariadbAnnotateRowsEvent , self ).__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
124
+ super ().__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
125
125
self .sql_statement = self .packet .read (event_size )
126
126
127
127
def _dump (self ):
128
- super (MariadbAnnotateRowsEvent , self )._dump ()
128
+ super ()._dump ()
129
129
print ("SQL statement :" , self .sql_statement )
130
130
131
131
@@ -137,7 +137,7 @@ class RotateEvent(BinLogEvent):
137
137
next_binlog: Name of next binlog file
138
138
"""
139
139
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
140
- super (RotateEvent , self ).__init__ (from_packet , event_size , table_map ,
140
+ super ().__init__ (from_packet , event_size , table_map ,
141
141
ctl_connection , ** kwargs )
142
142
self .position = struct .unpack ('<Q' , self .packet .read (8 ))[0 ]
143
143
self .next_binlog = self .packet .read (event_size - 8 ).decode ()
@@ -158,7 +158,7 @@ class XAPrepareEvent(BinLogEvent):
158
158
xid: serialized XID representation of XA transaction
159
159
"""
160
160
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
161
- super (XAPrepareEvent , self ).__init__ (from_packet , event_size , table_map ,
161
+ super ().__init__ (from_packet , event_size , table_map ,
162
162
ctl_connection , ** kwargs )
163
163
164
164
# one_phase is True: XA COMMIT ... ONE PHASE
@@ -182,7 +182,7 @@ def _dump(self):
182
182
183
183
class FormatDescriptionEvent (BinLogEvent ):
184
184
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
185
- super (FormatDescriptionEvent , self ).__init__ (from_packet , event_size , table_map ,
185
+ super ().__init__ (from_packet , event_size , table_map ,
186
186
ctl_connection , ** kwargs )
187
187
self .binlog_version = struct .unpack ('<H' , self .packet .read (2 ))
188
188
self .mysql_version_str = self .packet .read (50 ).rstrip (b'\0 ' ).decode ()
@@ -206,12 +206,12 @@ class XidEvent(BinLogEvent):
206
206
"""
207
207
208
208
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
209
- super (XidEvent , self ).__init__ (from_packet , event_size , table_map ,
209
+ super ().__init__ (from_packet , event_size , table_map ,
210
210
ctl_connection , ** kwargs )
211
211
self .xid = struct .unpack ('<Q' , self .packet .read (8 ))[0 ]
212
212
213
213
def _dump (self ):
214
- super (XidEvent , self )._dump ()
214
+ super ()._dump ()
215
215
print ("Transaction ID: %d" % (self .xid ))
216
216
217
217
@@ -236,21 +236,21 @@ class HeartbeatLogEvent(BinLogEvent):
236
236
"""
237
237
238
238
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
239
- super (HeartbeatLogEvent , self ).__init__ (from_packet , event_size ,
239
+ super ().__init__ (from_packet , event_size ,
240
240
table_map , ctl_connection ,
241
241
** kwargs )
242
242
self .ident = self .packet .read (event_size ).decode ()
243
243
244
244
def _dump (self ):
245
- super (HeartbeatLogEvent , self )._dump ()
245
+ super ()._dump ()
246
246
print ("Current binlog: %s" % (self .ident ))
247
247
248
248
249
249
class QueryEvent (BinLogEvent ):
250
250
'''This event is trigger when a query is run of the database.
251
251
Only replicated queries are logged.'''
252
252
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
253
- super (QueryEvent , self ).__init__ (from_packet , event_size , table_map ,
253
+ super ().__init__ (from_packet , event_size , table_map ,
254
254
ctl_connection , ** kwargs )
255
255
256
256
# Post-header
@@ -276,7 +276,7 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection, **kwargs)
276
276
#string[EOF] query
277
277
278
278
def _dump (self ):
279
- super (QueryEvent , self )._dump ()
279
+ super ()._dump ()
280
280
print ("Schema: %s" % (self .schema ))
281
281
print ("Execution time: %d" % (self .execution_time ))
282
282
print ("Query: %s" % (self .query ))
@@ -376,15 +376,15 @@ class BeginLoadQueryEvent(BinLogEvent):
376
376
block-data
377
377
"""
378
378
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
379
- super (BeginLoadQueryEvent , self ).__init__ (from_packet , event_size , table_map ,
379
+ super ().__init__ (from_packet , event_size , table_map ,
380
380
ctl_connection , ** kwargs )
381
381
382
382
# Payload
383
383
self .file_id = self .packet .read_uint32 ()
384
384
self .block_data = self .packet .read (event_size - 4 )
385
385
386
386
def _dump (self ):
387
- super (BeginLoadQueryEvent , self )._dump ()
387
+ super ()._dump ()
388
388
print ("File id: %d" % (self .file_id ))
389
389
print ("Block data: %s" % (self .block_data ))
390
390
@@ -405,7 +405,7 @@ class ExecuteLoadQueryEvent(BinLogEvent):
405
405
dup_handling_flags
406
406
"""
407
407
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
408
- super (ExecuteLoadQueryEvent , self ).__init__ (from_packet , event_size , table_map ,
408
+ super ().__init__ (from_packet , event_size , table_map ,
409
409
ctl_connection , ** kwargs )
410
410
411
411
# Post-header
@@ -442,15 +442,15 @@ class IntvarEvent(BinLogEvent):
442
442
value
443
443
"""
444
444
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
445
- super (IntvarEvent , self ).__init__ (from_packet , event_size , table_map ,
445
+ super ().__init__ (from_packet , event_size , table_map ,
446
446
ctl_connection , ** kwargs )
447
447
448
448
# Payload
449
449
self .type = self .packet .read_uint8 ()
450
450
self .value = self .packet .read_uint32 ()
451
451
452
452
def _dump (self ):
453
- super (IntvarEvent , self )._dump ()
453
+ super ()._dump ()
454
454
print ("type: %d" % (self .type ))
455
455
print ("Value: %d" % (self .value ))
456
456
@@ -467,7 +467,7 @@ class RandEvent(BinLogEvent):
467
467
"""
468
468
469
469
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
470
- super (RandEvent , self ).__init__ (from_packet , event_size , table_map ,
470
+ super ().__init__ (from_packet , event_size , table_map ,
471
471
ctl_connection , ** kwargs )
472
472
# Payload
473
473
self ._seed1 = self .packet .read_uint64 ()
@@ -484,7 +484,7 @@ def seed2(self):
484
484
return self ._seed2
485
485
486
486
def _dump (self ):
487
- super (RandEvent , self )._dump ()
487
+ super ()._dump ()
488
488
print ("seed1: %d" % (self .seed1 ))
489
489
print ("seed2: %d" % (self .seed2 ))
490
490
@@ -505,7 +505,7 @@ class MariadbStartEncryptionEvent(BinLogEvent):
505
505
"""
506
506
507
507
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
508
- super (MariadbStartEncryptionEvent , self ).__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
508
+ super ().__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
509
509
510
510
self .schema = self .packet .read_uint8 ()
511
511
self .key_version = self .packet .read_uint32 ()
@@ -519,6 +519,6 @@ def _dump(self):
519
519
520
520
class NotImplementedEvent (BinLogEvent ):
521
521
def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
522
- super (NotImplementedEvent , self ).__init__ (
522
+ super ().__init__ (
523
523
from_packet , event_size , table_map , ctl_connection , ** kwargs )
524
524
self .packet .advance (event_size )
0 commit comments