-
Notifications
You must be signed in to change notification settings - Fork 314
Merge | TdsParser.cs #3622
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
Merge | TdsParser.cs #3622
Conversation
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.
Only enabled on netfx for now
Also reduced indentation level in ProcessSNIError by swapping using block for using statement
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs
Show resolved
Hide resolved
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 |
netfx-only features: * trigger debug assertion when client certificate bit is set. * hide passwords from TdsParserStateObject (when merged)
See line 6778 of change to netcore TdsParser in dotnet#3605
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? |
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this 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!
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
Outdated
Show resolved
Hide resolved
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
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
Add braces to TNIR handling, explicit parameter name for exitContext
There was a problem hiding this 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 🥳
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
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
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:
|
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.