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

Add test for handling precision overflow when casting from integer to decimal #6041

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

viirya
Copy link
Member

@viirya viirya commented Apr 18, 2023

Which issue does this PR close?

Closes #5825.

Rationale for this change

What changes are included in this PR?

This issue was fixed at the upstream. Now adding a test for verification.

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate sqllogictest SQL Logic Tests (.slt) labels Apr 18, 2023
Comment on lines +596 to +599
query R
select try_cast(1234567 as decimal(7,3));
----
NULL
Copy link
Member Author

Choose a reason for hiding this comment

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

I've verified that this returns incorrect result 1234.567 before the fix.

@viirya
Copy link
Member Author

viirya commented Apr 18, 2023

Thanks @Dandandan

@Dandandan Dandandan merged commit cf27870 into apache:main Apr 18, 2023
@Dandandan
Copy link
Contributor

Thanks @viirya

@viirya viirya deleted the cast_integer_decimal_precision branch April 18, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataFusion incorrectly handle precision overflow when casting from integer to decimal
3 participants