Skip to content

Conversation

benrr101
Copy link
Contributor

@benrr101 benrr101 commented Jul 9, 2025

Description

For compliance reasons, we have to take a change to the SqlDecimal type workarounds in netfx.

Issues

N/A

Testing

Added unit tests for verifying the behavior of the sql type workarounds

@benrr101 benrr101 added this to the 6.1.0 milestone Jul 9, 2025
@Copilot Copilot AI review requested due to automatic review settings July 9, 2025 17:41
@benrr101 benrr101 requested a review from a team as a code owner July 9, 2025 17:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR backports changes for the SqlDecimal workaround in .NET Framework by removing the complex reflection-based decomposer and replacing it with a simple Data-property implementation, along with new unit tests to verify behavior.

  • Simplified SqlDecimalExtractData to use SqlDecimal.Data instead of reflection/serialization hacks
  • Removed unused Reflection.Emit/Runtime.Serialization usings and the old helper class
  • Added unit tests covering SqlDecimalExtractData for both null and non-null inputs

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.netfx.cs Replaced the reflection-based SqlDecimal decomposer with direct use of SqlDecimal.Data
src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft/Data/SqlTypes/SqlTypeWorkaroundsTests.cs Added tests for SqlDecimalExtractData, including null and non-null scenarios
Comments suppressed due to low confidence (1)

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlTypes/SqlTypeWorkarounds.netfx.cs:148

  • [nitpick] The indentation of the data1 assignment is misaligned compared to the other assignments; please align it for consistent readability.
            data1 = (uint)data[0];

@cheenamalhotra cheenamalhotra changed the base branch from main to release/6.1 July 9, 2025 19:52
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.61%. Comparing base (df35633) to head (3b1fdef).
Report is 1 commits behind head on release/6.1.

Additional details and impacted files
@@               Coverage Diff               @@
##           release/6.1    #3467      +/-   ##
===============================================
+ Coverage        66.91%   67.61%   +0.69%     
===============================================
  Files              280      280              
  Lines            62386    62325      -61     
===============================================
+ Hits             41745    42138     +393     
+ Misses           20641    20187     -454     
Flag Coverage Δ
addons 92.58% <ø> (ø)
netcore 72.78% <ø> (+3.81%) ⬆️
netfx 66.22% <100.00%> (-3.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cheenamalhotra cheenamalhotra merged commit 3396340 into release/6.1 Jul 10, 2025
129 checks passed
@cheenamalhotra cheenamalhotra deleted the dev/russellben/6.1-mdata branch July 10, 2025 19:12
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.

3 participants