-
Notifications
You must be signed in to change notification settings - Fork 311
Merge | TdsParser.GetSniErrorDetails #3434
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
base: main
Are you sure you want to change the base?
Conversation
/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.
Makes perfect sense to me - nice that we will be able to drop these OS-specific files!
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.
One tiny question.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
Outdated
Show resolved
Hide resolved
/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.
Changes look great! just a few nits.
{ | ||
SniError sniError = SniProxy.Instance.GetLastError(); | ||
|
||
return new SniErrorDetails(sniError.errorMessage, sniError.nativeError, sniError.sniError, (int)sniError.provider, sniError.lineNumber, sniError.function, sniError.exception); |
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.
nit: Please consider chopping these into multiple lines.
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.
Thanks. Formatted in both places, with the exception
parameter on an extra line for netcore.
{ | ||
SniNativeWrapper.SniGetLastError(out SniError sniError); | ||
|
||
return new SniErrorDetails(sniError.errorMessage, sniError.nativeError, sniError.sniError, (int)sniError.provider, sniError.lineNumber, sniError.function); |
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.
nit: same here.
d643b06
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3434 +/- ##
==========================================
- Coverage 63.51% 59.63% -3.88%
==========================================
Files 293 274 -19
Lines 63810 62012 -1798
==========================================
- Hits 40526 36983 -3543
- Misses 23284 25029 +1745
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 is a slightly smaller merge, but it's the first of its type.
TdsParser.Windows.cs and TdsParser.Unix.cs have a number of methods which vary in behaviour based upon
TdsParserStateObjectFactory.UseManagedSNI
. This PR handles those methods by moving the method to theTdsParserStateObject
base class, implementing them in the Native and Managed child classes, then updating the references to use the state object.Once this process is complete, we'll be able to remove the OS-specific TdsParser files.
Issues
Contributes to #1261.
Testing
Unit tests pass locally, but I'd like a CI run please.