Skip to content

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Jan 10, 2024

We are failing 42 sqllogictest with the same error: Out of bounds value for decimal type.

This is caused by Case performing a convert to a decimal type that had a bad exclusiveUpperBound.
MySQL has specific rules about the precision , scale, and conversion of decimals, and it is difficult to match their behavior exactly.
Fortunately, the result is correct before the conversion, so the fix here is to just use the result, and not convert.

This is somewhat of a bandaid fix; decimal type is an area that needs more improvement in general.

Fixes dolthub/dolt#7079

}
ret, _, err := t.Convert(val)
return ret, err
if ret, _, err := t.Convert(val); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure i understand, we were failing to convert a decimal to an int8 or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we were incorrectly returning an Out of bounds value for decimal type error

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jycor jycor merged commit 0801138 into main Jan 10, 2024
@jycor jycor deleted the james/decimal branch January 10, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in evaluating expression: "Out of range value for column of Decimal type"

2 participants