Skip to content

Commit 57c7e98

Browse files
holyssiddontang
authored andcommitted
AddSet should handle nil uuidset (go-mysql-org#136)
1 parent e83b166 commit 57c7e98

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mysql/mysql_gtid.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func ParseMysqlGTIDSet(str string) (GTIDSet, error) {
295295
if str == "" {
296296
return s, nil
297297
}
298-
298+
299299
sp := strings.Split(str, ",")
300300

301301
//todo, handle redundant same uuid
@@ -336,6 +336,9 @@ func DecodeMysqlGTIDSet(data []byte) (*MysqlGTIDSet, error) {
336336
}
337337

338338
func (s *MysqlGTIDSet) AddSet(set *UUIDSet) {
339+
if set == nil {
340+
return
341+
}
339342
sid := set.SID.String()
340343
o, ok := s.Sets[sid]
341344
if ok {

0 commit comments

Comments
 (0)