Commit 625c483
committed
Add missing MySQL 8.0+ binlog event types and handle unknown types gracefully
The ConstEventType enum is missing all event types added in MySQL 8.0+
(types 36-42), causing a ValueError crash when the library encounters
any of them. The most commonly triggered one is PARTIAL_UPDATE_ROWS_EVENT
(type 39), emitted when binlog_row_value_options=PARTIAL_JSON is enabled.
Changes:
- Add all missing MySQL 8.0+ event types to ConstEventType:
- TRANSACTION_CONTEXT_EVENT (36)
- VIEW_CHANGE_EVENT (37)
- XA_PREPARE_LOG_EVENT (38)
- PARTIAL_UPDATE_ROWS_EVENT (39)
- TRANSACTION_PAYLOAD_EVENT (40)
- HEARTBEAT_LOG_EVENT_V2 (41)
- GTID_TAGGED_LOG_EVENT (42)
- Use tryFrom() instead of from() in EventInfo to gracefully handle
any future unrecognized event types instead of crashing
Ref: https://github.com/mysql/mysql-server/blob/824e2b4064053f7daf17d7f3f84b7a3ed92e5fb4/libs/mysql/binlog/event/binlog_event.h#L2851 parent 2cb76cd commit 625c483
File tree
2 files changed
+10
-1
lines changed- src/MySQLReplication
- Definitions
- Event
2 files changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments