Skip to content

Commit c8a68c2

Browse files
committed
set IsValidFloat to var
1 parent da5de2d commit c8a68c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/types/number.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,8 @@ func ConvertHexBlobToDecimalForNumericContext(val interface{}, originType sql.Ty
15661566
return val, nil
15671567
}
15681568

1569-
// IsValidFloat returns false if a float is NaN or infinity
1570-
func IsValidFloat(f float64) bool {
1569+
// IsValidFloat returns false in go-mysql-server if a float is NaN or infinity. Since NaN and infinity values are
1570+
// allowed in Doltgres, this function is replaced there.
1571+
var IsValidFloat = func(f float64) bool {
15711572
return !math.IsNaN(f) && !math.IsInf(f, 0)
15721573
}

0 commit comments

Comments
 (0)