-
Notifications
You must be signed in to change notification settings - Fork 314
[6.1] Fix TryReadPlpBytes throws ArgumentException #3474
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
Conversation
* add clearing of data sizes when a multi-part result is returned * remove asserts detecting overwrite of snapshot storage which are now no longer accurate * remove empty statement block --------- Co-authored-by: Wraith2 <Wraith2@gmaill.com>
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.
Pull Request Overview
Ports the fix from issue #3470 into the 6.1 release branch, ensuring snapshot buffers and data sizes are reset after successful reads.
- Replaces
SetSnapshotDataSize
withAddSnapshotDataSize
to accumulate read sizes instead of overwriting. - Introduces
ClearSnapshotDataSize
and clears snapshot storage when transitioning between packets. - Removes outdated
Debug.Assert
comments and ports similar changes to both .NET Framework and .NET Core parsers.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs | Use AddSnapshotDataSize , add ClearSnapshotDataSize() , clear snapshot storage, drop stale asserts |
src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/TdsParser.cs | Port ClearSnapshotDataSize() and switch to AddSnapshotDataSize in packet‐size increment |
src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParser.cs | Port ClearSnapshotDataSize() and switch to AddSnapshotDataSize in packet‐size increment |
Comments suppressed due to low confidence (3)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs:3582
- Newly added methods
AddSnapshotDataSize
andClearSnapshotDataSize
don’t appear to have direct unit tests. Consider adding targeted tests to verify that snapshot data size and storage are properly reset after operations.
internal void AddSnapshotDataSize(int countOfBytesCopiedFromCurrentPacket)
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/6.1 #3474 +/- ##
===============================================
- Coverage 68.87% 66.81% -2.07%
===============================================
Files 280 280
Lines 62322 62344 +22
===============================================
- Hits 42927 41655 -1272
- Misses 19395 20689 +1294
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:
|
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.
* Revert 1af7327 * Revert "Fix TryReadPlpBytes throws ArgumentException (#3470) (#3474)" This reverts commit 0a55896. * Revert 44762d9 * Revert "Improve async string perf and fix reading chars with initial offset. (#3377)" This reverts commit 05df554. * Revert "Refine handling of moving between replay and continue states (#3337)" This reverts commit 265f522. * Revert "Fix SqlCached buffer async read with continue edge case. (#3329)" This reverts commit c3857b1. * Revert "Add `async` snapshot continue capability for multipacket fields (#3161)" This reverts commit 33364e7. * Revert "Add partial packet detection and fixup (#2714)" This reverts commit 8d5e4f2. * Remove methods previously moved to common file. * Supply byte buffer to vector read. * Minor compilation fixes that were missed in the reverts. * Remove partial packet context switch helpers. * Remove accidental duplication of SqlDataReader * Revert len change * Undo buff rental in netfx to simplify 6.0 diff. * Fix missed rented buff code. --------- Co-authored-by: Cheena Malhotra <cmalhotra@microsoft.com>
Description
Ports #3470 to release/6.1
Issues
fixes #3463
fixes #3385