Skip to content

Commit bf73d97

Browse files
committed
Merge branch 'main' of https://github.com/23-OSSCA-python-mysql-replication/python-mysql-replication into feature/typing-packet-gtid-binlogstream
2 parents b9b241b + 19fe16c commit bf73d97

File tree

7 files changed

+645
-127
lines changed

7 files changed

+645
-127
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Featured
6363

6464
[Streaming Changes in a Database with Amazon Kinesis](https://aws.amazon.com/blogs/database/streaming-changes-in-a-database-with-amazon-kinesis/) (by Emmanuel Espina, Amazon Web Services)
6565

66+
[Near Zero Downtime Migration from MySQL to DynamoDB](https://aws.amazon.com/ko/blogs/big-data/near-zero-downtime-migration-from-mysql-to-dynamodb/) (by YongSeong Lee, Amazon Web Services)
6667

6768
Projects using this library
6869
===========================

Diff for: pymysqlreplication/binlogstream.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
BeginLoadQueryEvent, ExecuteLoadQueryEvent,
1717
HeartbeatLogEvent, NotImplementedEvent, MariadbGtidEvent,
1818
MariadbAnnotateRowsEvent, RandEvent, MariadbStartEncryptionEvent, RowsQueryLogEvent,
19-
MariadbGtidListEvent, MariadbBinLogCheckPointEvent)
19+
MariadbGtidListEvent, MariadbBinLogCheckPointEvent, UserVarEvent,
20+
PreviousGtidsEvent)
2021
from .exceptions import BinLogNotEnabled
2122
from .gtid import GtidSet
2223
from .packet import BinLogPacketWrapper
@@ -148,7 +149,8 @@ def __init__(self, connection_settings: Dict, server_id: int,
148149
slave_heartbeat: Optional[float] = None,
149150
is_mariadb: bool = False,
150151
annotate_rows_event: bool = False,
151-
ignore_decode_errors: bool = False) -> None:
152+
ignore_decode_errors: bool = False,
153+
verify_checksum = False) -> None:
152154
"""
153155
Attributes:
154156
ctl_connection_settings[Dict]: Connection settings for cluster holding
@@ -188,6 +190,7 @@ def __init__(self, connection_settings: Dict, server_id: int,
188190
used with 'is_mariadb'
189191
ignore_decode_errors[bool]: If true, any decode errors encountered
190192
when reading column data will be ignored.
193+
verify_checksum[bool]: If true, verify events read from the binary log by examining checksums.
191194
"""
192195

193196
self.__connection_settings: Dict = connection_settings
@@ -210,6 +213,7 @@ def __init__(self, connection_settings: Dict, server_id: int,
210213
only_events, ignored_events, filter_non_implemented_events)
211214
self.__fail_on_table_metadata_unavailable: bool = fail_on_table_metadata_unavailable
212215
self.__ignore_decode_errors: bool = ignore_decode_errors
216+
self.__verify_checksum: bool = verify_checksum
213217

214218
# We can't filter on packet level TABLE_MAP and rotate event because
215219
# we need them for handling other operations
@@ -541,7 +545,8 @@ def fetchone(self) -> Union[BinLogPacketWrapper, None]:
541545
self.__ignored_schemas,
542546
self.__freeze_schema,
543547
self.__fail_on_table_metadata_unavailable,
544-
self.__ignore_decode_errors)
548+
self.__ignore_decode_errors,
549+
self.__verify_checksum,)
545550

546551
if binlog_event.event_type == ROTATE_EVENT:
547552
self.log_pos = binlog_event.event.position
@@ -632,7 +637,9 @@ def _allowed_event_list(self, only_events: Optional[List[str]], ignored_events:
632637
RandEvent,
633638
MariadbStartEncryptionEvent,
634639
MariadbGtidListEvent,
635-
MariadbBinLogCheckPointEvent
640+
MariadbBinLogCheckPointEvent,
641+
UserVarEvent,
642+
PreviousGtidsEvent
636643
))
637644
if ignored_events is not None:
638645
for e in ignored_events:

0 commit comments

Comments
 (0)