fixed unused error

This commit is contained in:
agapple
2019-09-01 11:20:00 +08:00
parent cfc95e2b7a
commit 5addd246ac
2 changed files with 5 additions and 4 deletions

View File

@@ -24,8 +24,8 @@ public class SimpleCanalClientTest extends AbstractCanalClientTest {
String ip = AddressUtils.getHostIp(); String ip = AddressUtils.getHostIp();
CanalConnector connector = CanalConnectors.newSingleConnector(new InetSocketAddress(ip, 11111), CanalConnector connector = CanalConnectors.newSingleConnector(new InetSocketAddress(ip, 11111),
destination, destination,
"", "canal",
""); "canal");
final SimpleCanalClientTest clientTest = new SimpleCanalClientTest(destination); final SimpleCanalClientTest clientTest = new SimpleCanalClientTest(destination);
clientTest.setConnector(connector); clientTest.setConnector(connector);

View File

@@ -521,13 +521,14 @@ public class MysqlConnection implements ErosaConnection {
try { try {
rs = query("select @@global.binlog_checksum"); rs = query("select @@global.binlog_checksum");
List<String> columnValues = rs.getFieldValues(); List<String> columnValues = rs.getFieldValues();
if (columnValues != null && columnValues.size() >= 1 && columnValues.get(0) != null && 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; binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_CRC32;
} else { } else {
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF; binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.error("", e); // logger.error("", e);
binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF; binlogChecksum = LogEvent.BINLOG_CHECKSUM_ALG_OFF;
} }
} }