Skip to content

[4.x] [MSSQL] Encode negative-scale BigDecimal values correctly - #1803

Merged
tsegismont merged 1 commit into
4.xfrom
backport/1776-to-4.x
Nov 13, 2026
Merged

tsegismont merged 1 commit into
4.xfrom
backport/1776-to-4.x

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #1776 to 4.x
Cherry-picked commit: aa33932

* Encode negative-scale BigDecimal values correctly

The scale byte was clamped to zero but the unscaled value was not
multiplied back, so 1.5E+3 (1500 after stripTrailingZeros) was sent
as 15.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-opus-5-5)

* Extract the numeric parameter scale

Compute the scale once for the parameter definition and the encoded
value, and cover a negative value with a negative scale.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-fable-5-2)

---------

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
(cherry picked from commit aa33932)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont
tsegismont merged commit 97e434b into 4.x Nov 13, 2026
18 checks passed
@tsegismont
tsegismont deleted the backport/1776-to-4.x branch November 13, 2026 10:41
@tsegismont tsegismont added this to the 4.5.37 milestone Nov 13, 2026
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