mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Merge pull request #294 from travisturner/overflow-fix
error on potential overflow
This commit is contained in:
commit
0691b6c015
1 changed files with 3 additions and 0 deletions
|
|
@ -4596,6 +4596,9 @@ func getScaledInt(f *Field, v interface{}) (int64, error) {
|
|||
if opt.Type == FieldTypeDecimal {
|
||||
switch tv := v.(type) {
|
||||
case uint64:
|
||||
if tv > math.MaxInt64 {
|
||||
return 0, errors.Errorf("uint64 value out of range for pql.Decimal: %d", tv)
|
||||
}
|
||||
dec := pql.NewDecimal(int64(tv), 0)
|
||||
value = decimalToInt64(dec, opt)
|
||||
case int64:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue