From 0c06ccc35ea9df6fd0859ec5bec5f5a51bcdf0f7 Mon Sep 17 00:00:00 2001 From: zhang2014 Date: Tue, 15 Sep 2020 23:26:13 +0800 Subject: [PATCH] Fix parse error packet on event --- src/Core/MySQL/MySQLReplication.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Core/MySQL/MySQLReplication.cpp b/src/Core/MySQL/MySQLReplication.cpp index 81d46d10025..a46d787b225 100644 --- a/src/Core/MySQL/MySQLReplication.cpp +++ b/src/Core/MySQL/MySQLReplication.cpp @@ -803,20 +803,20 @@ namespace MySQLReplication void MySQLFlavor::readPayloadImpl(ReadBuffer & payload) { - MySQLBinlogEventReadBuffer event_payload(payload); - UInt16 header = static_cast(*event_payload.position()); + UInt16 header = static_cast(*payload.position()); switch (header) { case PACKET_EOF: throw ReplicationError("Master maybe lost", ErrorCodes::UNKNOWN_EXCEPTION); case PACKET_ERR: ERRPacket err; - err.readPayloadWithUnpacked(event_payload); + err.readPayloadWithUnpacked(payload); throw ReplicationError(err.error_message, ErrorCodes::UNKNOWN_EXCEPTION); } // skip the header flag. - event_payload.ignore(1); + payload.ignore(1); + MySQLBinlogEventReadBuffer event_payload(payload); EventType event_type = static_cast(*(event_payload.position() + 4)); switch (event_type) {