修复通过show master status获取到多个GTID 时,回车符导致UUID 解析失败的bug

This commit is contained in:
winger
2018-10-19 10:27:50 +08:00
parent ff592758cf
commit c16037122b

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]);