Skip to content

Conversation

edwardneal
Copy link
Contributor

Description

This PR merges the TdsParser class in its entirety. It's currently waiting for the TdsParserStateObject interface to settle in #3603, but since this is one of the largest classes in the project I'm submitting it early so that we have a head start in reviewing it.

Prior to any changes, there was approximately a +/-200 line diff between the files. This PR currently closes that diff commit-by-commit, narrowing it to -20/+1. Once everyone's happy with #3603, I'll close that gap completely, then delete one of the now-identical files in the final commit.

I'd strongly recommend reviewing commit-by-commit, with whitespace changes disabled.

At present, this is marked as a draft. Once the files are merged, I'll mark it as ready for review.

@benrr101 and anyone else who wants to wade through the commits for an initial review.

Issues

Contributes to #1261.
Fixes #2953.

Testing

Automatic tests pass locally. I don't think there's any point running CI yet though.

netfx: remove empty try/finally structure
netcore: add connection dooming
Also eliminates allocation of UnicodeEncoding
The exitContext parameter is ignored on netcore and applied on netfx
No need to call AsSpan, this conversion is implicit. No need to slice to length bytes, length is already defined as the length of unencryptedBytes.
Also enables use of cached _decimalBits in netfx, this wasn't present before
Remove Yoda condition from netcore. Remove comparison which is always true from netfx.
Also reduced indentation level in ProcessSNIError by swapping using block for using statement
@edwardneal
Copy link
Contributor Author

I've seen that #3603 has been merged, and have been testing the git merge on a local branch. I think this needs a clean slate for the platform-specific TdsParser.cs files though - it's not workable otherwise. I'll keep waiting until #3605 has been merged, then proceed.

Incidentally, there's a stray TdsParser.cs file in $(CommonSourceRoot). This isn't displayed in Visual Studio right now, and that file will also need to be removed.

netfx-only features:
* trigger debug assertion when client certificate bit is set.
* hide passwords from TdsParserStateObject (when merged)
@edwardneal
Copy link
Contributor Author

I'm opening this up for review, although I appreciate it'll almost certainly take a while.

The top-level PR's diff is appalling, I think the figure has been confused by the final hurdle of renaming the shared TdsParser.SSPI.cs to TdsParser.cs, then merging the existing files to TdsParser.cs. The only way to review this is going to be commit-by-commit. Could someone start a CI run please?

@edwardneal edwardneal marked this pull request as ready for review September 24, 2025 18:38
@edwardneal edwardneal requested a review from a team as a code owner September 24, 2025 18:38
@edwardneal edwardneal changed the title [Draft] Merge | TdsParser Merge | TdsParser.cs Sep 24, 2025
@mdaigle
Copy link
Contributor

mdaigle commented Sep 24, 2025

/azp run

@mdaigle mdaigle self-assigned this Sep 24, 2025
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@paulmedynski paulmedynski self-assigned this Sep 25, 2025
Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

Only thing I'm blocking on is the _connHandler assignment line that should probably be removed. Otherwise, fantastic work, thank you so much for getting this worked out!

Add braces to TNIR handling, explicit parameter name for exitContext
Copy link
Contributor

@mdaigle mdaigle left a comment

Choose a reason for hiding this comment

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

Two small requests. Otherwise looks good 🥳

@benrr101 benrr101 added the Common Project 🚮 Things that relate to the common project project label Sep 29, 2025
@benrr101 benrr101 added this to the 7.0-preview2 milestone Sep 29, 2025
@benrr101
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@benrr101 benrr101 merged commit 33a8d53 into dotnet:main Sep 30, 2025
236 checks passed
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (37d8a3f) to head (0839219).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #3622       +/-   ##
==========================================
- Coverage   66.13%       0   -66.14%     
==========================================
  Files         276       0      -276     
  Lines       60765       0    -60765     
==========================================
- Hits        40184       0    -40184     
+ Misses      20581       0    -20581     
Flag Coverage Δ
addons ?
netcore ?
netfx ?

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.

@edwardneal edwardneal deleted the merge/tdsparser-complete branch October 1, 2025 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Common Project 🚮 Things that relate to the common project project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work towards merging TdsParser
5 participants