MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / ParseMysqlGTIDSet

Function ParseMysqlGTIDSet

IceFireDB-SQLProxy/pkg/mysql/mysql/mysql_gtid.go:304–322  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

302}
303
304func ParseMysqlGTIDSet(str string) (GTIDSet, error) {
305 s := new(MysqlGTIDSet)
306 s.Sets = make(map[string]*UUIDSet)
307 if str == "" {
308 return s, nil
309 }
310
311 sp := strings.Split(str, ",")
312
313 // todo, handle redundant same uuid
314 for i := 0; i < len(sp); i++ {
315 if set, err := ParseUUIDSet(sp[i]); err != nil {
316 return nil, errors.Trace(err)
317 } else {
318 s.AddSet(set)
319 }
320 }
321 return s, nil
322}
323
324func DecodeMysqlGTIDSet(data []byte) (*MysqlGTIDSet, error) {
325 s := new(MysqlGTIDSet)

Callers 5

TestMysqlGTIDCodecMethod · 0.70
TestMysqlUpdateMethod · 0.70
TestMysqlGTIDContainMethod · 0.70
UpdateMethod · 0.70
ParseGTIDSetFunction · 0.70

Calls 2

ParseUUIDSetFunction · 0.70
AddSetMethod · 0.45

Tested by 3

TestMysqlGTIDCodecMethod · 0.56
TestMysqlUpdateMethod · 0.56
TestMysqlGTIDContainMethod · 0.56