Skip to content

fix: prevent overflow when parsing extreme decimal exponents - #128

Open
pcbeingused33 wants to merge 1 commit into
questdb:mainfrom
pcbeingused33:fix/decimal-exponent-limits
Open

pcbeingused33 wants to merge 1 commit into
questdb:mainfrom
pcbeingused33:fix/decimal-exponent-limits

Conversation

@pcbeingused33

@pcbeingused33 pcbeingused33 commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes #126

Decimal exponent arithmetic could overflow before precision and scale checks, allowing an extreme exponent to reach the powers-of-ten table and throw ArrayIndexOutOfBoundsException instead of NumericException.

Keep the intermediate exponent, virtual scale, digit-drop count and precision calculations in long arithmetic. Validate the natural scale and final precision before narrowing values for the decimal representation. Exponents remain parsed as integers, preserving the accepted input syntax.

@pcbeingused33

Copy link
Copy Markdown
Author

Could you rerun Azure validation for this PR or share the first failing step from build 289018? Its public logs return HTTP 404. This appears to be the only recent PR opened from a fork, and the "Checkout PR source branch" step runs git fetch origin $(System.PullRequest.SourceBranch). Against the base repository that fetch fails with couldn't find remote ref refs/heads/fix/decimal-exponent-limits, since the branch lives on the fork (refs/pull/128/head points to the same commit). The Javadoc command and the full mvn -P javadoc clean install pass on Corretto 8 for this head.

This comment was drafted with AI assistance.

This branch has not been deployed

No deployments
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.

Decimal text with an exponent near the int limits throws ArrayIndexOutOfBoundsException

1 participant