diff --git a/pkg/clone/transactionstream.go b/pkg/clone/transactionstream.go index 931c656..fbc9337 100644 --- a/pkg/clone/transactionstream.go +++ b/pkg/clone/transactionstream.go @@ -127,7 +127,7 @@ func (s *TransactionStream) Run(ctx context.Context, b backoff.BackOff, output c continue } currentTransaction.Mutations = append(currentTransaction.Mutations, s.toMutation(e, event)) - case *replication.XIDEvent: + case *replication.XIDEvent: // the last event in a transaction gset := event.GSet currentTransaction.FinalPosition = Position{ File: nextPos.Name, @@ -156,6 +156,7 @@ func (s *TransactionStream) Run(ctx context.Context, b backoff.BackOff, output c func (s *TransactionStream) toMutation(e *replication.BinlogEvent, event *replication.RowsEvent) Mutation { mutationType := toMutationType(e.Header.EventType) + fmt.Printf("mutationType = %s, RowsEvent = %v\n", mutationType, event) switch mutationType { case Update: if len(event.Rows)%2 != 0 { diff --git a/pkg/clone/transactionwriter.go b/pkg/clone/transactionwriter.go index 9a13cd2..e267036 100644 --- a/pkg/clone/transactionwriter.go +++ b/pkg/clone/transactionwriter.go @@ -617,6 +617,7 @@ func (m *Mutation) replace(ctx context.Context, tx DBWriter) error { valueStrings := make([]string, 0, len(m.Rows)) valueArgs := make([]interface{}, 0, len(m.Rows)*len(tableSchema.Columns)) for _, row := range m.Rows { + fmt.Printf("tableName = %s, row = %v\n", tableName, row) if len(row) != len(m.Table.Columns) { panic(fmt.Sprintf("row column count %d doesn't match the cached table schema columns: %v (%v), "+ "there may have been a schema change and you will most likely need to restart replication by deleting"+