Skip to content

Commit c0b9211

Browse files
author
James Cor
committed
restore
1 parent 9da98e7 commit c0b9211

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

sql/core.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626
"time"
2727
"unsafe"
2828

29-
"github.com/dolthub/vitess/go/mysql"
3029
"github.com/shopspring/decimal"
3130
"gopkg.in/src-d/go-errors.v1"
3231

@@ -316,11 +315,7 @@ func ConvertToBool(ctx *Context, v interface{}) (bool, error) {
316315
case float64:
317316
return b != 0, nil
318317
case string:
319-
truncStr, didTrunc := TruncateStringToDouble(b)
320-
if didTrunc {
321-
ctx.Warn(mysql.ERTruncatedWrongValue, "%s", ErrTruncatedIncorrect.New("INTEGER", b))
322-
}
323-
bFloat, err := strconv.ParseFloat(truncStr, 64)
318+
bFloat, err := strconv.ParseFloat(TrimStringToNumberPrefix(ctx, b, false), 64)
324319
if err != nil {
325320
return false, nil
326321
}

0 commit comments

Comments
 (0)