Skip to content

Commit a46dbec

Browse files
author
James Cor
committed
aaaaa
1 parent 7dc6f70 commit a46dbec

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

sql/expression/convert.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ func convertValue(ctx *sql.Context, val interface{}, castTo string, originType s
355355
return d, nil
356356
case ConvertToDouble, ConvertToReal:
357357
d, _, err := types.Float64.Convert(ctx, val)
358-
if err != nil {
359-
return nil, err
360-
}
361-
d, _, err := types.Float64.Convert(ctx, value)
362358
if err != nil {
363359
if sql.ErrTruncatedIncorrect.Is(err) {
364360
ctx.Warn(1265, "%s", err.Error())

sql/types/number.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,7 @@ func convertToInt64(t NumberTypeImpl_, v interface{}) (int64, sql.ConvertInRange
990990
}
991991
return i, sql.InRange, nil
992992
case string:
993+
993994
if len(v) == 0 {
994995
// StringType{}.Zero() returns empty string, but should represent "0" for number value
995996
return 0, sql.InRange, nil

0 commit comments

Comments
 (0)