Skip to content

Commit

Permalink
Merge pull request #20 from sysown/mysql_8_support
Browse files Browse the repository at this point in the history
Add new patch to `libslave` acknowledging new MySQL 8 Binlog Even Types - Closes #2
  • Loading branch information
renecannao authored Sep 13, 2022
2 parents b519bd6 + 286d327 commit 7f50bd0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ libslave/libslave.a:
patch -p0 < patches/libslave_DBUG_ASSERT.patch
patch -p0 < patches/libslave_ER_MALFORMED_GTID_SET_ENCODING.patch
patch -p0 < patches/libslave_SSL_MODE_DISABLED.patch
patch -p0 < patches/libslave_MySQL_8_new_events.patch
cd libslave && cmake .
cd libslave && make slave_a

Expand Down
42 changes: 42 additions & 0 deletions patches/libslave_MySQL_8_new_events.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git libslave/slave_log_event.cpp libslave/slave_log_event.cpp
index 6277100..6a86497 100644
--- libslave/slave_log_event.cpp
+++ libslave/slave_log_event.cpp
@@ -364,6 +364,13 @@ bool read_log_event(const char* buf, uint event_len, Basic_event_info& bei, Even
case TRANSACTION_CONTEXT_EVENT:
case VIEW_CHANGE_EVENT:
case XA_PREPARE_LOG_EVENT:
+ // UNSUPPORTED: MySQL 8 events - We only acknowledge the existence of this
+ // events, they remain UNSUPPORTED by this library.
+ // ========================================================================
+ case PARTIAL_UPDATE_ROWS_EVENT:
+ case TRANSACTION_PAYLOAD_EVENT:
+ case HEARTBEAT_LOG_EVENT_V2:
+ // ========================================================================
if (event_stat)
event_stat->tickOther();
return false;
diff --git libslave/slave_log_event.h libslave/slave_log_event.h
index 9c66d9f..b5eb714 100644
--- libslave/slave_log_event.h
+++ libslave/slave_log_event.h
@@ -87,6 +87,19 @@ enum Log_event_type

XA_PREPARE_LOG_EVENT= 38,

+ // 8.0 UNSUPPORTED: MySQL 8 events - We only acknowledge the existence of this
+ // events, they remain UNSUPPORTED by this library. Source:
+ // - https://github.com/mysql/mysql-server/blob/8.0/libbinlogevents/include/binlog_event.h#L347
+ // ========================================================================
+
+ PARTIAL_UPDATE_ROWS_EVENT= 39,
+
+ TRANSACTION_PAYLOAD_EVENT= 40,
+
+ HEARTBEAT_LOG_EVENT_V2= 41,
+
+ // ========================================================================
+
ENUM_END_EVENT
};

0 comments on commit 7f50bd0

Please sign in to comment.