Repository navigation
fix: numeric strings read decimal, money and smallmoney as exact text (#498) - #500
Merged
Merged
Conversation
…, as numeric (#498) decimal is numeric under another name, but under numeric strings it went through a double (digits lost, "5" where numeric gives "5.00"). SQL_DECIMAL now takes numeric's path: the driver's text, every digit and the scale. Both get the zero before the point the driver leaves out ("-0.50", was "-.50"). Prepared statements still bind these columns as a double: corpus scripts/issue-498-prepared pins it as known-bug. scripts/issue-498 is agreed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #498: the second half of the fix. Prepared statements are still open, so this does not close the issue.
decimalisnumericunder another name, but with numeric strings on it went through a double: it lost digits and gave different text fromnumeric("5"against"5.00").SQL_DECIMAL(decimal,money,smallmoney) now takesnumeric's path, the driver's exact text, read by a newget_data_numeric_string. Both types also get the zero before the point that the driver leaves out.decimal(38,2)12345678901234567890.12"12345678901234567000""12345678901234567890.12"decimal(19,0)9007199254740993"9007199254740992""9007199254740993"money922337203685477.5807"922337203685477.6""922337203685477.5807"decimal(5,2)5"5""5.00"numeric(5,2)-0.5"-.50""-0.50"numeric(10,7)0.0000001".0000001""0.0000001"Behaviour change, for the release notes:
decimalkeeps its scale, andnumericanddecimalvalues below 1 get a leading zero. This applies only with numeric strings on.Still open in #498: prepared statements bind
numeric/decimalresult columns as a double. Pinned as known-bug in corpusscripts/issue-498-prepared.Tests: corpus
scripts/issue-498(agreed; the prepared case moved to its own script); unit tests for exact text, scale, leading zero and null; thesetUseNumericStringdoc is updated. Full suite on Windows / ODBC 18: 1194 passing, 1 pending.🤖 Generated with Claude Code