Null point Exception during loading the checksum (#1788)

If you connect to the mysql with version 5.1, the result of command 'select @master_binlog_checksum' is an array with only one Null element .
This commit is contained in:
Sweet
2019-05-11 17:17:54 +08:00
committed by agapple
parent 8f088cddc0
commit 4c690fb5a3

View File

@@ -521,7 +521,7 @@ public class MysqlConnection implements ErosaConnection {
try {
rs = query("select @@global.binlog_checksum");
List<String> columnValues = rs.getFieldValues();
if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0).toUpperCase().equals("CRC32")) {
if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0) != null && columnValues.get(0).toUpperCase().equals("CRC32")) {
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
} else {
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;