Skip to content

fix: fix decimal div and add tests#3952

Merged
parthchandra merged 5 commits intoapache:mainfrom
parthchandra:ansi_decimal_div
Apr 17, 2026
Merged

fix: fix decimal div and add tests#3952
parthchandra merged 5 commits intoapache:mainfrom
parthchandra:ansi_decimal_div

Conversation

@parthchandra
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes # #1526

Rationale for this change

Adds one fix in decimal div and adds additional tests

What changes are included in this PR?

Fixes decimal div for the Ansi path. Also adds sql file tests

How are these changes tested?

Existing and new tests

@parthchandra parthchandra marked this pull request as draft April 15, 2026 21:33
@parthchandra parthchandra marked this pull request as ready for review April 16, 2026 21:23
SELECT cast(10 as decimal(18,0)) div cast(0.000000 as decimal(18,6))

-- ============================================================================
-- TRY mode: try_divide returns NULL even when ANSI is enabled globally
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a try_divide overflow case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Copy Markdown
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

Thanks @parthchandra

@parthchandra parthchandra merged commit 3356f85 into apache:main Apr 17, 2026
174 of 176 checks passed
@parthchandra
Copy link
Copy Markdown
Contributor Author

Merged. Thank you @andygrove

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.

2 participants