mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
mysql5.6.29'@@global.binlog_checksum'带单引号导致master退出,优化binlogFormat判断
This commit is contained in:
@@ -199,7 +199,8 @@ public class MysqlConnection implements ErosaConnection {
|
|||||||
// 如果不设置会出现错误: Slave can not handle replication events with the
|
// 如果不设置会出现错误: Slave can not handle replication events with the
|
||||||
// checksum that master is configured to log
|
// checksum that master is configured to log
|
||||||
// 但也不能乱设置,需要和mysql server的checksum配置一致,不然RotateLogEvent会出现乱码
|
// 但也不能乱设置,需要和mysql server的checksum配置一致,不然RotateLogEvent会出现乱码
|
||||||
update("set @master_binlog_checksum= '@@global.binlog_checksum'");
|
// '@@global.binlog_checksum'需要去掉单引号,在mysql 5.6.29下导致master退出
|
||||||
|
update("set @master_binlog_checksum= @@global.binlog_checksum");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.warn(ExceptionUtils.getFullStackTrace(e));
|
logger.warn(ExceptionUtils.getFullStackTrace(e));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
|
|||||||
for (BinlogFormat supportFormat : supportBinlogFormats) {
|
for (BinlogFormat supportFormat : supportBinlogFormats) {
|
||||||
if (supportFormat != null && format == supportFormat) {
|
if (supportFormat != null && format == supportFormat) {
|
||||||
found = true;
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,6 +108,7 @@ public class MysqlEventParser extends AbstractMysqlEventParser implements CanalE
|
|||||||
for (BinlogImage supportImage : supportBinlogImages) {
|
for (BinlogImage supportImage : supportBinlogImages) {
|
||||||
if (supportImage != null && image == supportImage) {
|
if (supportImage != null && image == supportImage) {
|
||||||
found = true;
|
found = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user