mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
bugfix: 兼容MariaDB GTID 为空的情况 (#5352)
This commit is contained in:
@@ -24,9 +24,12 @@ public class MariaGTIDSet implements GTIDSet {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(String str) {
|
public void update(String str) {
|
||||||
|
if (StringUtils.isNotEmpty(str)) {
|
||||||
|
// 兼容 GTID 为空的情况,例如 mysql-bin.000001 的 GTID 是空的
|
||||||
MariaGtid mariaGtid = MariaGtid.parse(str);
|
MariaGtid mariaGtid = MariaGtid.parse(str);
|
||||||
gtidMap.put(mariaGtid.getDomainId(), mariaGtid);
|
gtidMap.put(mariaGtid.getDomainId(), mariaGtid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void add(MariaGtid mariaGtid) {
|
public void add(MariaGtid mariaGtid) {
|
||||||
gtidMap.put(mariaGtid.getDomainId(), mariaGtid);
|
gtidMap.put(mariaGtid.getDomainId(), mariaGtid);
|
||||||
|
|||||||
Reference in New Issue
Block a user