Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkg/clone/transactionstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/clone/transactionwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"+
Expand Down