Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stored procedure call returns wrong BigDecimal scale. #2559

Closed
wants to merge 25 commits into from

Conversation

Ananya2
Copy link
Contributor

@Ananya2 Ananya2 commented Dec 6, 2024

#2534 - Set scale value dynamically for DECIMAL output parameters in registerOutParameter method.

This change retrieves the scale from the ParameterMetaData and applies it to the DECIMAL output parameter. This provides a more flexible approach for handling DECIMAL data types.

As an alternative, users can directly call registerOutParameter(index, sqlType, scale) to specify the scale explicitly.

@Ananya2 Ananya2 changed the title Stored procedure call returns wrong BigDecimal scale. Stored procedure call returns wrong BigDecimal scale. https://github.com/microsoft/mssql-jdbc/issues/2534 Dec 6, 2024
@Ananya2 Ananya2 changed the title Stored procedure call returns wrong BigDecimal scale. https://github.com/microsoft/mssql-jdbc/issues/2534 Stored procedure call returns wrong BigDecimal scale. Dec 6, 2024
@Jeffery-Wasty Jeffery-Wasty linked an issue Dec 6, 2024 that may be closed by this pull request
Copy link

codecov bot commented Dec 6, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 51.08%. Comparing base (ae462f9) to head (ed0ff76).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...oft/sqlserver/jdbc/SQLServerCallableStatement.java 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2559      +/-   ##
============================================
+ Coverage     50.99%   51.08%   +0.09%     
- Complexity     3911     3925      +14     
============================================
  Files           147      147              
  Lines         33456    33480      +24     
  Branches       5604     5609       +5     
============================================
+ Hits          17060    17103      +43     
+ Misses        13992    13967      -25     
- Partials       2404     2410       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Ananya2 Ananya2 self-assigned this Dec 7, 2024
Copy link
Contributor

@machavan machavan left a comment

Choose a reason for hiding this comment

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

Let us also add a test that resembles the two customer reported scenarios

@Ananya2 Ananya2 requested review from machavan and divang December 9, 2024 11:51
@Ananya2 Ananya2 requested a review from lilgreenbird December 9, 2024 17:06
@Jeffery-Wasty Jeffery-Wasty added this to the 12.11.0 milestone Dec 9, 2024
@tkyc
Copy link
Member

tkyc commented Dec 9, 2024

pinged you about an internal test fail

Copy link
Contributor

@lilgreenbird lilgreenbird left a comment

Choose a reason for hiding this comment

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

this failed tests in internal test lab

@Ananya2 Ananya2 requested a review from machavan December 16, 2024 07:21
@Ramudaykumar
Copy link

There should be significant comments in code, so that a new person can understand the code.

@Ananya2
Copy link
Contributor Author

Ananya2 commented Dec 20, 2024

There should be significant comments in code, so that a new person can understand the code.
Noted.

Copy link
Contributor

@lilgreenbird lilgreenbird left a comment

Choose a reason for hiding this comment

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

doesn't look like the formatter was run on BigDecimalPrecisionTest.java, pls make sure to run formatter on all files

Ananya2 and others added 25 commits January 10, 2025 11:00
Set scale value dynamically for DECIMAL output parameters in registerOutParameter method.

This change retrieves the scale from the ParameterMetaData and applies it to the DECIMAL output parameter. This provides a more flexible approach for handling DECIMAL data types. 

As an alternative, users can directly call registerOutParameter(index, sqlType, scale) to specify the scale explicitly.
…in the dynamic handling of DECIMAL output parameters.
@Ananya2 Ananya2 force-pushed the users/anagarg/issue#2534 branch from cb7d65a to b2d7c07 Compare January 10, 2025 05:35
@Ananya2
Copy link
Contributor Author

Ananya2 commented Jan 16, 2025

Changes have already been requested as a part of #2582, hence closing the PR.

@Ananya2 Ananya2 closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

Stored procedure call return wrong BigDecimal scale.
7 participants