mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed #227 , loadBinlogChecksum NPE
This commit is contained in:
@@ -266,9 +266,11 @@ public class MysqlConnection implements ErosaConnection {
|
||||
throw new IllegalStateException("unexpected binlog image query result:" + rs.getFieldValues());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主库checksum信息
|
||||
* https://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html#option_mysqld_binlog-checksum
|
||||
* https://dev.mysql.com/doc/refman/5.6/en/replication-options
|
||||
* -binary-log.html#option_mysqld_binlog-checksum
|
||||
*/
|
||||
private void loadBinlogChecksum() {
|
||||
ResultSetPacket rs = null;
|
||||
@@ -279,7 +281,7 @@ public class MysqlConnection implements ErosaConnection {
|
||||
}
|
||||
|
||||
List<String> columnValues = rs.getFieldValues();
|
||||
if(columnValues.get(0).toUpperCase().equals("CRC32")){
|
||||
if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0).toUpperCase().equals("CRC32")) {
|
||||
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
|
||||
} else {
|
||||
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;
|
||||
|
||||
Reference in New Issue
Block a user