mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fix: uuidset combine fix (#3432)
This commit is contained in:
@@ -181,7 +181,9 @@ public class UUIDSet {
|
||||
int j;
|
||||
for (j = i + 1; j < len; j++) {
|
||||
if (intervals.get(i).stop >= intervals.get(j).start) {
|
||||
intervals.get(i).stop = intervals.get(j).stop;
|
||||
if (intervals.get(i).stop < intervals.get(j).stop) {
|
||||
intervals.get(i).stop = intervals.get(j).stop;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,18 @@ public class MysqlGTIDSetTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUpdate() {
|
||||
String gtid1 = "726757ad-4455-11e8-ae04-0242ac110002:1-25536412";
|
||||
MysqlGTIDSet mysqlGTIDSet1 = MysqlGTIDSet.parse(gtid1);
|
||||
|
||||
String gtid2 = "726757ad-4455-11e8-ae04-0242ac110002:1-20304074";
|
||||
MysqlGTIDSet mysqlGTIDSet2 = MysqlGTIDSet.parse(gtid2);
|
||||
|
||||
mysqlGTIDSet1.update(gtid2);
|
||||
assertEquals("726757ad-4455-11e8-ae04-0242ac110002:1-25536412", mysqlGTIDSet1.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParse() {
|
||||
Map<String, MysqlGTIDSet> cases = new HashMap<>(5);
|
||||
|
||||
Reference in New Issue
Block a user