Skip to content

Commit deb87a8

Browse files
author
James Cor
committed
use types.Compare
1 parent 3f56ad6 commit deb87a8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sql/plan/foreign_key_editor.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ func (fkEditor *ForeignKeyEditor) Update(ctx *sql.Context, old sql.Row, new sql.
8484
// Only check the reference for the columns that are updated
8585
hasChange := false
8686
for _, idx := range reference.RowMapper.IndexPositions {
87-
if old[idx] != new[idx] {
87+
cmp, err := fkEditor.Schema[idx].Type.Compare(old[idx], new[idx])
88+
if err != nil {
89+
return err
90+
}
91+
if cmp != 0 {
8892
hasChange = true
8993
break
9094
}

0 commit comments

Comments
 (0)