From b349b400cfbc2d963490a84f762773ecf8aa9484 Mon Sep 17 00:00:00 2001 From: zikaifeng Date: Tue, 27 Sep 2016 16:22:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dissue=20#=20201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../otter/canal/parse/inbound/mysql/MysqlConnection.java | 3 +++ 1 file changed, 3 insertions(+) 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 c8cb12b8..5e19c1d4 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 @@ -6,6 +6,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.List; +import com.taobao.tddl.dbsync.binlog.LogPosition; import org.apache.commons.lang.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,6 +90,7 @@ public class MysqlConnection implements ErosaConnection { decoder.handle(LogEvent.QUERY_EVENT); decoder.handle(LogEvent.XID_EVENT); LogContext context = new LogContext(); + context.setLogPosition(new LogPosition(binlogfilename)); while (fetcher.fetch()) { LogEvent event = null; event = decoder.decode(fetcher, context); @@ -110,6 +112,7 @@ public class MysqlConnection implements ErosaConnection { fetcher.start(connector.getChannel()); LogDecoder decoder = new LogDecoder(LogEvent.UNKNOWN_EVENT, LogEvent.ENUM_END_EVENT); LogContext context = new LogContext(); + context.setLogPosition(new LogPosition(binlogfilename)); while (fetcher.fetch()) { LogEvent event = null; event = decoder.decode(fetcher, context);