Skip to content

Commit b0a00b0

Browse files
committed
[ga-format-pr] Run ./format_repo.sh to fix formatting
1 parent e5c7130 commit b0a00b0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

sql/plan/alter_foreign_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ func foreignKeyComparableTypes(ctx *sql.Context, type1 sql.Type, type2 sql.Type)
655655
if (types.IsTime(type1) || types.IsTimespan(type1)) && (types.IsTime(type2) || types.IsTimespan(type2)) {
656656
// MySQL allows time-related types to reference each other in foreign keys:
657657
// - DATETIME can reference DATETIME with different precision
658-
// - TIMESTAMP can reference TIMESTAMP with different precision
658+
// - TIMESTAMP can reference TIMESTAMP with different precision
659659
// - DATETIME can reference TIMESTAMP and vice versa
660660
// - TIME can reference TIME with different precision
661661
return true

sql/plan/foreign_key_editor.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,15 @@ func (reference *ForeignKeyReferenceHandler) validateTimeConstraints(row sql.Row
599599
parentType := parentCol.Type
600600
childColIdx := reference.RowMapper.IndexPositions[parentIdx]
601601
childType := reference.RowMapper.SourceSch[childColIdx].Type
602-
602+
603603
// Check if both types are time-related
604604
isChildTime := types.IsTime(childType) || types.IsTimespan(childType)
605605
isParentTime := types.IsTime(parentType) || types.IsTimespan(parentType)
606-
606+
607607
if !isChildTime || !isParentTime {
608608
continue
609609
}
610-
610+
611611
// MySQL requires exact type matching for time types in foreign key validation
612612
if !childType.Equals(parentType) {
613613
return sql.ErrForeignKeyChildViolation.New(

0 commit comments

Comments
 (0)