(query string)
| 757 | ) |
| 758 | |
| 759 | func (b *BinlogReader) checkDtleQueryOSID(query string) error { |
| 760 | |
| 761 | start := strings.Index(query, dtleQueryPrefix) |
| 762 | if start == -1 { |
| 763 | return nil |
| 764 | } |
| 765 | start += len(dtleQueryPrefix) |
| 766 | |
| 767 | end := strings.Index(query, dtleQuerySuffix) |
| 768 | if end == -1 { |
| 769 | return fmt.Errorf("incomplete dtle_gtid for query %v", query) |
| 770 | } |
| 771 | if end < start { |
| 772 | return fmt.Errorf("bad dtle_gtid for query %v", query) |
| 773 | } |
| 774 | |
| 775 | dtleItem := query[start:end] |
| 776 | ss := strings.Split(dtleItem, " ") |
| 777 | if len(ss) != 3 { |
| 778 | return fmt.Errorf("bad dtle_gtid splitted for query %v", query) |
| 779 | } |
| 780 | |
| 781 | b.logger.Debug("query osid", "osid", ss[1], "gno", b.entryContext.Entry.Coordinates.GetGNO()) |
| 782 | |
| 783 | sid, err := uuid.FromString(ss[1]) |
| 784 | if err != nil { |
| 785 | return err |
| 786 | } |
| 787 | |
| 788 | b.entryContext.Entry.Coordinates.(*common.MySQLCoordinateTx).SID = sid |
| 789 | return nil |
| 790 | } |
| 791 | func (b *BinlogReader) setDtleQuery(query string) string { |
| 792 | if strings.Contains(query, "/*dtle_gtid1") { |
| 793 | return query |
no test coverage detected