Skip to content

Commit 843c66f

Browse files
authored
Merge branch 'master' into grodowski/panic-on-heartbeat-writer-retries-exhausted-gh
2 parents 5fbb66e + b897def commit 843c66f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

go/logic/applier.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package logic
88
import (
99
gosql "database/sql"
1010
"fmt"
11+
"reflect"
1112
"regexp"
1213
"strings"
1314
"sync/atomic"
@@ -1299,7 +1300,8 @@ func (this *Applier) updateModifiesUniqueKeyColumns(dmlEvent *binlog.BinlogDMLEv
12991300
tableOrdinal := this.migrationContext.OriginalTableColumns.Ordinals[column.Name]
13001301
whereColumnValue := dmlEvent.WhereColumnValues.AbstractValues()[tableOrdinal]
13011302
newColumnValue := dmlEvent.NewColumnValues.AbstractValues()[tableOrdinal]
1302-
if newColumnValue != whereColumnValue {
1303+
1304+
if !reflect.DeepEqual(whereColumnValue, newColumnValue) {
13031305
return column.Name, true
13041306
}
13051307
}

go/logic/applier_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func TestApplierGenerateSqlModeQuery(t *testing.T) {
6262
}
6363

6464
func TestApplierUpdateModifiesUniqueKeyColumns(t *testing.T) {
65-
columns := sql.NewColumnList([]string{"id", "item_id"})
66-
columnValues := sql.ToColumnValues([]interface{}{123456, 42})
65+
columns := sql.NewColumnList([]string{"id", "item_id", "item_text"})
66+
columnValues := sql.ToColumnValues([]interface{}{123456, 42, []uint8{116, 101, 115, 116}})
6767

6868
migrationContext := base.NewMigrationContext()
6969
migrationContext.OriginalTableColumns = columns

0 commit comments

Comments
 (0)