Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix float to decimal convert overflow #5607

Merged
merged 5 commits into from
Jun 14, 2019

Conversation

coraxster
Copy link
Contributor

@coraxster coraxster commented Jun 13, 2019

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Bug Fix

Short description (up to few sentences):

select toDecimal32(10000.1, 6); -- should be serverError 407
--2147.483648
select toDecimal64(10000.1, 18);  -- should be serverError 407
--9.223372036854775808
select toDecimal128(1000000000000000000000.1, 18);  -- should be serverError 407
0.000000000000000000

@4ertus2 4ertus2 self-requested a review June 13, 2019 12:26
@4ertus2 4ertus2 self-requested a review June 13, 2019 15:34
dbms/src/DataTypes/DataTypesDecimal.h Outdated Show resolved Hide resolved
@alexey-milovidov alexey-milovidov merged commit e90a707 into ClickHouse:master Jun 14, 2019
@CurtizJ CurtizJ added the pr-bugfix Pull request with bugfix, not backported by default label Jun 14, 2019
@coraxster
Copy link
Contributor Author

Got some non-fixed boundary cases. Made a new PR.
#5645

4ertus2 pushed a commit that referenced this pull request Jun 21, 2019
Fix float to decimal convert overflow

(cherry picked from commit e90a707)
@4ertus2 4ertus2 added the v19.9 label Jun 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants