fixed issue #440

This commit is contained in:
agapple
2017-12-10 22:27:14 +08:00
parent c60b04424b
commit 448fc8bcde

View File

@@ -761,15 +761,14 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
Long logposTimestamp = entry.getHeader().getExecuteTime(); Long logposTimestamp = entry.getHeader().getExecuteTime();
Long serverId = entry.getHeader().getServerId(); Long serverId = entry.getHeader().getServerId();
if (CanalEntry.EntryType.TRANSACTIONBEGIN.equals(entry.getEntryType()) if (logger.isDebugEnabled()) {
|| CanalEntry.EntryType.TRANSACTIONEND.equals(entry.getEntryType())) {
logger.debug("compare exit condition:{},{},{}, startTimestamp={}...", new Object[] { logger.debug("compare exit condition:{},{},{}, startTimestamp={}...", new Object[] {
logfilename, logfileoffset, logposTimestamp, startTimestamp }); logfilename, logfileoffset, logposTimestamp, startTimestamp });
}
// 事务头和尾寻找第一条记录时间戳,如果最小的一条记录都不满足条件,可直接退出 // 事务头和尾寻找第一条记录时间戳,如果最小的一条记录都不满足条件,可直接退出
if (logposTimestamp >= startTimestamp) { if (logposTimestamp >= startTimestamp) {
return false; return false;
} }
}
if (entryPosition == null) { if (entryPosition == null) {
// 如果啥都找不到,就返回第一条Format Event的位点,一般是116位点 // 如果啥都找不到,就返回第一条Format Event的位点,一般是116位点