(query string)
| 789 | return nil |
| 790 | } |
| 791 | func (b *BinlogReader) setDtleQuery(query string) string { |
| 792 | if strings.Contains(query, "/*dtle_gtid1") { |
| 793 | return query |
| 794 | } else { |
| 795 | coordinate := b.entryContext.Entry.Coordinates.(*common.MySQLCoordinateTx) |
| 796 | uuidStr := uuid.UUID(coordinate.SID).String() |
| 797 | tag := fmt.Sprintf("/*dtle_gtid1 %v %v %v dtle_gtid*/", b.execCtx.Subject, uuidStr, coordinate.GNO) |
| 798 | |
| 799 | upperQuery := strings.ToUpper(query) |
| 800 | if strings.HasPrefix(upperQuery, "CREATE DEFINER=") { |
| 801 | if strings.HasSuffix(upperQuery, "END") { |
| 802 | return fmt.Sprintf("%v %v END", query[:len(query)-3], tag) |
| 803 | } |
| 804 | } |
| 805 | return fmt.Sprintf("%v %v", query, tag) |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | func (b *BinlogReader) sendEntry(entriesChannel chan<- *common.EntryContext) { |
| 810 | isBig := b.entryContext.Entry.IsPartOfBigTx() |
no test coverage detected