From 5dc62bbda882b13f45a57bf14e55882aede54ef9 Mon Sep 17 00:00:00 2001 From: "jianhao.dai" Date: Wed, 4 Jan 2017 11:14:01 +0800 Subject: [PATCH] seek method also need load checksum --- .../otter/canal/parse/inbound/mysql/MysqlConnection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java index 908a36d8..95fedb30 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/MysqlConnection.java @@ -83,7 +83,7 @@ public class MysqlConnection implements ErosaConnection { */ public void seek(String binlogfilename, Long binlogPosition, SinkFunction func) throws IOException { updateSettings(); - + loadBinlogChecksum(); sendBinlogDump(binlogfilename, binlogPosition); DirectLogFetcher fetcher = new DirectLogFetcher(connector.getReceiveBufferSize()); fetcher.start(connector.getChannel()); @@ -94,6 +94,7 @@ public class MysqlConnection implements ErosaConnection { decoder.handle(LogEvent.XID_EVENT); LogContext context = new LogContext(); context.setLogPosition(new LogPosition(binlogfilename)); + context.setFormatDescription(new FormatDescriptionLogEvent(4, binlogChecksum)); while (fetcher.fetch()) { LogEvent event = null; event = decoder.decode(fetcher, context);