@@ -309,19 +309,12 @@ class XAPrepareEvent(BinLogEvent):
309
309
An XA prepare event is generated for a XA prepared transaction.
310
310
Like Xid_event, it contains XID of the **prepared** transaction.
311
311
312
- For more information: `[see details] <https://dev.mysql.com/doc/refman/8.0/en/xa-statements.html>`_.
313
-
314
- <<<<<<< HEAD
315
- :ivar one_phase: current XA transaction commit method
316
- :ivar xid_format_id: a number that identifies the format used by the gtrid and bqual values
317
- :ivar xid: serialized XID representation of XA transaction (xid_gtrid + xid_bqual)
318
- =======
319
- In detail, the class creates the following python objects in the constructor:
312
+ For more information: `[see XAPrepareEvent] <https://dev.mysql.com/doc/refman/8.0/en/xa-statements.html>`_.
320
313
321
314
:ivar one_phase: str - current XA transaction commit method
322
315
:ivar xid_format_id: int - a number that identifies the format used by the gtrid and bqual values
323
316
:ivar xid: str - serialized XID representation of XA transaction (xid_gtrid + xid_bqual)
324
- >>>>>>> 07b561d (add type hints to the rest of the events, improve docstring readability in some events)
317
+
325
318
"""
326
319
def __init__ (self ,
327
320
from_packet : Type [MysqlPacket ],
@@ -354,35 +347,14 @@ def _dump(self) -> None:
354
347
355
348
class FormatDescriptionEvent (BinLogEvent ):
356
349
"""
357
- <<<<<<< HEAD
358
- Represents a Format Description Event in the MySQL binary log.
350
+ The event Represents a Format Description Event in the MySQL binary log.
359
351
360
352
This event is written at the start of a binary log file for binlog version 4.
361
353
It provides the necessary information to decode subsequent events in the file.
362
354
363
355
:ivar binlog_version: int - Version of the binary log format.
364
356
:ivar mysql_version_str: str - Server's MySQL version in string format.
365
357
"""
366
-
367
- def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
368
- super ().__init__ (from_packet , event_size , table_map ,
369
- ctl_connection , ** kwargs )
370
- self .binlog_version = struct .unpack ('<H' , self .packet .read (2 ))
371
- self .mysql_version_str = self .packet .read (50 ).rstrip (b'\0 ' ).decode ()
372
- numbers = self .mysql_version_str .split ('-' )[0 ]
373
- self .mysql_version = tuple (map (int , numbers .split ('.' )))
374
- == == == =
375
- The event represents a Format Description Event in the MySQL binary log .
376
-
377
- This event is written at the start of a binary log file for binlog version 4.
378
- It provides the necessary information to decode subsequent events in the file .
379
-
380
- In detail , the class creates the following python objects in the constructor :
381
- >> >> >> > 07 b561d (add type hints to the rest of the events , improve docstring readability in some events )
382
-
383
- :ivar binlog_version : str - Version of the binary log format
384
- :ivar mysql_version_str : str - Server 's MySQL version in string format
385
- """
386
358
def __init__ (self ,
387
359
from_packet : Type [MysqlPacket ],
388
360
event_size : int ,
@@ -409,22 +381,12 @@ class StopEvent(BinLogEvent):
409
381
class XidEvent (BinLogEvent ):
410
382
< << << << HEAD
411
383
"""
412
- A COMMIT event generated when COMMIT of a transaction that modifies one or more tables of an XA - capable storage engine occurs .
413
-
414
- For more information : `[see details] <https://mariadb.com/kb/en/xid_event/>` _ .
415
-
416
- :ivar xid : uint - Transaction ID for 2 Phase Commit .
417
- == == == =
418
- >> > >> > > 07 b561d (add type hints to the rest of the events , improve docstring readability in some events )
419
- """
420
- A COMMIT event is generated when COMMIT of a transaction that modifies
384
+ A COMMIT event generated when COMMIT of a transaction that modifies
421
385
one or more tables of an XA-capable storage engine occurs.
422
386
423
- For more information : `[see details ] <https://mariadb.com/kb/en/xid_event/>`_.
387
+ For more information: `[see XidEvent ] <https://mariadb.com/kb/en/xid_event/>`_.
424
388
425
- In detail, the class creates the following python objects in the constructor:
426
-
427
- :ivar xid: int - Transaction ID for 2 Phase Commit
389
+ :ivar xid: uint - Transaction ID for 2 Phase Commit.
428
390
"""
429
391
def __init__ (self ,
430
392
from_packet : Type [MysqlPacket ],
@@ -457,19 +419,11 @@ class HeartbeatLogEvent(BinLogEvent):
457
419
(see Binlog_sender::send_events in sql/rpl_binlog_sender.cc)
458
420
459
421
Warning:
460
- <<<<<<< HEAD
461
422
That makes 106 bytes of data for skipped event in the binlog.
462
423
*this is also the case with GTID replication*.
463
424
To mitigate such behavior, you are expected to keep the binlog small
464
425
(see max_binlog_size, defaults to 1G).
465
426
In any case, the timestamp is 0 (as in 1970-01-01T00:00:00).
466
- =======
467
- That makes 106 bytes of data for skipped event in the binlog.
468
- *this is also the case with GTID replication*.
469
- To mitigate such behavior, you are expected to keep the binlog small
470
- (see max_binlog_size, defaults to 1G).
471
- In any case, the timestamp is 0 (as in 1970-01-01T00:00:00).
472
- >>>>>>> 07b561d (add type hints to the rest of the events, improve docstring readability in some events)
473
427
474
428
In detail, the class creates the following python objects in the constructor:
475
429
@@ -532,15 +486,9 @@ def __init__(self,
532
486
self .schema : str = self .packet .read (self .schema_length )
533
487
self .packet .advance (1 )
534
488
535
- << << < << HEAD
536
- query = self .packet .read (event_size - 13 - self .status_vars_length
537
- - self .schema_length - 1 )
538
- self .query = query .decode ("utf-8" , errors = 'backslashreplace' )
539
- == == == =
489
+ #string[EOF] query
540
490
self .query : str = self .packet .read (event_size - 13 - self .status_vars_length
541
491
- self .schema_length - 1 ).decode ("utf-8" )
542
- >> >> > >> 07 b561d (add type hints to the rest of the events , improve docstring readability in some events )
543
- #string[EOF] query
544
492
545
493
def _dump (self ) -> None :
546
494
"""Dump the python objects for the event."""
@@ -605,11 +553,7 @@ def _read_status_vars_value_for_key(self, key: int) -> Union[None, NoReturn]:
605
553
elif key == Q_TIME_ZONE_CODE : # 0x05
606
554
time_zone_len = self .packet .read_uint8 ()
607
555
if time_zone_len :
608
- << < << < < HEAD
609
- self .time_zone = self .packet .read (time_zone_len )
610
- == == == =
611
556
self .time_zone : str = self .packet .read (time_zone_len )
612
- >> >> > >> 07 b561d (add type hints to the rest of the events , improve docstring readability in some events )
613
557
elif key == Q_CATALOG_NZ_CODE : # 0x06
614
558
catalog_len = self .packet .read_uint8 ()
615
559
if catalog_len :
@@ -756,19 +700,11 @@ def _dump(self) -> None:
756
700
757
701
class IntvarEvent (BinLogEvent ):
758
702
"""
759
- <<<<<<< HEAD
760
703
Stores the value of auto-increment variables.
761
704
This event will be created just before a QueryEvent.
762
705
763
706
:ivar type: int - 1 byte identifying the type of variable stored.
764
- =======
765
- The event stores the value of auto-increment variables.
766
- It will be created just before a QueryEvent.
767
-
768
- In detail, the class creates the following python objects in the constructor:
769
-
770
- :ivar type: int - 1 byte identifying the type of variable stored. \
771
- >>>>>>> 07b561d (add type hints to the rest of the events, improve docstring readability in some events)
707
+
772
708
Can be either LAST_INSERT_ID_EVENT (1) or INSERT_ID_EVENT (2).
773
709
:ivar value: int - The value of the variable
774
710
"""
@@ -804,11 +740,7 @@ class RandEvent(BinLogEvent):
804
740
:ivar seed1: int - value for the first seed
805
741
:ivar seed2: int - value for the second seed
806
742
"""
807
- << < << << HEAD
808
- def __init__ (self , from_packet , event_size , table_map , ctl_connection , ** kwargs ):
809
- super ().__init__ (from_packet , event_size , table_map ,
810
- ctl_connection , ** kwargs )
811
- == == == =
743
+
812
744
def __init__ (self ,
813
745
from_packet : Type [MysqlPacket ],
814
746
event_size : int ,
@@ -817,7 +749,6 @@ def __init__(self,
817
749
** kwargs : str ):
818
750
super ().__init__ (from_packet , event_size , table_map , ctl_connection , ** kwargs )
819
751
820
- >> > >> >> 07 b561d (add type hints to the rest of the events , improve docstring readability in some events )
821
752
# Payload
822
753
self ._seed1 : int = self .packet .read_uint64 ()
823
754
self ._seed2 : int = self .packet .read_uint64 ()
0 commit comments