Skip to content

Conversation

@shifluxxc
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

Decimal values with negative scale represent multiplication by a power of ten, but the decimal-to-integer conversion helpers previously rejected such values. This caused valid negative-scale decimals to fail during evaluation

What changes are included in this PR?

Update decimal32_to_i32, decimal64_to_i64, and decimal128_to_i128 to correctly handle negative scales by multiplying instead of returning an error.

Are these changes tested?

Yes. Existing unit tests were updated and new cases were added to validate correct behavior

@github-actions github-actions bot added sqllogictest SQL Logic Tests (.slt) common Related to common crate functions Changes to functions implementation labels Dec 31, 2025
@shifluxxc shifluxxc closed this Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate functions Changes to functions implementation sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant