File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 1515package sql
1616
1717import (
18+ "math"
1819 "reflect"
1920 "strconv"
2021 "time"
2122
22- "github.com/shopspring/decimal"
23-
2423 "github.com/dolthub/vitess/go/sqltypes"
2524 "github.com/dolthub/vitess/go/vt/proto/query"
25+ "github.com/shopspring/decimal"
2626 "gopkg.in/src-d/go-errors.v1"
2727)
2828
@@ -110,6 +110,9 @@ func (t yearType) Convert(v interface{}) (interface{}, error) {
110110 case float32 :
111111 return t .Convert (int64 (value ))
112112 case float64 :
113+ if value < float64 (math .MinInt64 ) || value > float64 (math .MaxInt64 ) {
114+ return nil , ErrConvertingToYear .New ("float64 value out of bounds for int64" )
115+ }
113116 return t .Convert (int64 (value ))
114117 case decimal.Decimal :
115118 return t .Convert (value .IntPart ())
You can’t perform that action at this time.
0 commit comments