Merge pull request #1014 from wingerx/master

修复通过`show master status`获取到多个GTID 时,回车符导致UUID 解析失败的bug
This commit is contained in:
agapple
2018-10-19 12:57:47 +08:00
committed by GitHub

View File

@@ -86,7 +86,8 @@ public class MysqlGTIDSet implements GTIDSet {
if (gtidData == null || gtidData.length() < 1) {
m = new HashMap<String, UUIDSet>();
} else {
String[] uuidStrs = gtidData.split(",");
// 存在多个GTID时会有回车符
String[] uuidStrs = gtidData.replaceAll("\n", "").split(",");
m = new HashMap<String, UUIDSet>(uuidStrs.length);
for (int i = 0; i < uuidStrs.length; i++) {
UUIDSet uuidSet = UUIDSet.parse(uuidStrs[i]);