Skip to content

Commit 100bba6

Browse files
committed
fix: update error message for decimal value size limit
1 parent f486bab commit 100bba6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

buffer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ func TestDecimalColumnErrors(t *testing.T) {
608608
bigVal := new(big.Int).Lsh(big.NewInt(1), 2100)
609609
dec := qdb.NewDecimal(bigVal, 0)
610610
err := buf.Table(testTable).DecimalColumn("price", dec).At(time.Time{}, false)
611-
assert.ErrorContains(t, err, "exceeds 256-bit range")
611+
assert.ErrorContains(t, err, "exceeds 127-bytes limit")
612612
assert.Empty(t, buf.Messages())
613613
})
614614

decimal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func (d ScaledDecimal) toBinary() (byte, []byte, error) {
139139
payload = []byte{0}
140140
}
141141
if len(payload) > maxDecimalBytes {
142-
return 0, nil, fmt.Errorf("decimal value exceeds 256-bit range (got %d bytes)", len(payload))
142+
return 0, nil, fmt.Errorf("decimal value exceeds 127-bytes limit (got %d bytes)", len(payload))
143143
}
144144
return byte(d.scale), payload, nil
145145
}

0 commit comments

Comments
 (0)