Merge | TdsParser functional changes#3555
Merged
benrr101 merged 23 commits intodotnet:mainfrom Sep 16, 2025
Merged
Conversation
netcore: removed a simple WriteInt which did nothing besides call BinaryPrimitives. netcore: when there's space in the packet buffer, WriteInt will now write to it directly (rather than write to a stack-allocated span and copy.)
This removes the need for TdsParser.netcore.cs.
…s never referenced in the format string
Messages of the netfx exceptions are more detailed
Added mask to netcore logic. Also removed mask on _encryptionOption from netfx - this will never be outside the range of EncryptionOptions.OPTIONS_MASK.
… is set and certificate is not automatically trusted
This passed state around, but never passed enough state to remove the state machine. Sync with netcore.
…instances from WriteUnterminatedSqlValue
Wraith2
reviewed
Aug 11, 2025
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
Wraith2
reviewed
Aug 11, 2025
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
Wraith2
reviewed
Aug 11, 2025
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
paulmedynski
requested changes
Aug 27, 2025
Contributor
paulmedynski
left a comment
There was a problem hiding this comment.
Looks good, with a few questions/suggestions.
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
Remove unnecessary conditional compilation. Add XML documentation to clarify SerializeShort, WriteShort et al.
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
paulmedynski
previously approved these changes
Aug 28, 2025
mdaigle
reviewed
Aug 28, 2025
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
Both platforms will now show the TransparentNetworkIPResolution status. This is always disabled on netcore.
mdaigle
reviewed
Sep 3, 2025
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
mdaigle
previously approved these changes
Sep 3, 2025
benrr101
previously approved these changes
Sep 3, 2025
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
paulmedynski
previously approved these changes
Sep 4, 2025
Contributor
|
@edwardneal - I think a merge from main will help clear up some of these CI failures. |
c421d87
Contributor
Author
|
Thanks @paulmedynski - I've just merged, can you re-run CI please? |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3555 +/- ##
==========================================
- Coverage 65.48% 61.83% -3.66%
==========================================
Files 275 267 -8
Lines 61518 61338 -180
==========================================
- Hits 40288 37931 -2357
- Misses 21230 23407 +2177
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
paulmedynski
approved these changes
Sep 16, 2025
benrr101
approved these changes
Sep 16, 2025
Contributor
benrr101
left a comment
There was a problem hiding this comment.
Let's gooooooooooooooooo 🚀
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.
Description
This should cover all necessary functional changes to TdsParser. With these changes merged, the class as a whole should be ready to merge after TdsParserStateObject is dealt with.
Not all of these changes are functional - some are simply necessary to see the real ones clearly. Possibly impactful commits here are:
ints and there was space in the packet buffer,WriteIntwould write the bytes to a stackalloc'dSpan<byte>and then copy into the buffer. I've eliminated the unnecessary intermediary span, and we now write directly into the buffer.There's also one other commit (6d98357) which looks more impactful than it is.
s_xmlMetadataSubstituteSequenceands_jsonMetadataSubstituteSequenceare the same length, so there's no runtime impact here.Issues
Relates to #1261.
Testing
Unit tests passed locally.