Skip to content

Commit 575b04b

Browse files
committed
Remove redundant check for fk validation
1 parent 505a850 commit 575b04b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sql/plan/alter_foreign_key.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,17 +535,13 @@ func FindForeignKeyColMapping(
535535
return nil, nil, fmt.Errorf("column `%s` in foreign key `%s` cannot be found",
536536
colName, fkName)
537537
}
538-
expectedType := localSchTypeMap[colName]
539538
destFkCol := destTblName + "." + destFKCols[fkIdx]
540539
indexPos, ok := indexColMap[destFkCol]
541540
if !ok {
542541
// Same as above, renaming a referenced column would cause this error
543-
return nil, nil, fmt.Errorf("index column `%s` in foreign key `%s` cannot be found",
542+
return nil, nil, fmt.Errorf("inde x column `%s` in foreign key `%s` cannot be found",
544543
destFKCols[fkIdx], fkName)
545544
}
546-
if !foreignKeyComparableTypes(ctx, indexTypeMap[destFkCol], expectedType) {
547-
return nil, nil, sql.ErrForeignKeyColumnTypeMismatch.New(colName, destFkCol)
548-
}
549545
indexPositions[indexPos] = localRowPos
550546
}
551547
return indexPositions, appendTypes, nil

0 commit comments

Comments
 (0)