This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
SqlClient shrink SqlParameter and fix 34414 #35549
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
46aa6ca
rework parameter booleans into bitfields
Wraith2 d6ae531
cleanup multipart parsing and rebuild
Wraith2 1751e6b
Merge remote-tracking branch 'dotnet/master' into sqlfix-34414
Wraith2 f8661df
UDTParams_DeriveParameters test
Wraith2 728e703
copy parameter flags in a single step
Wraith2 c494400
Merge remote-tracking branch 'dotnet/master' into sqlfix-34414
Wraith2 097e867
address feedback
Wraith2 4aa2516
address feedback
Wraith2 4dca9ee
Merge remote-tracking branch 'dotnet/master' into sqlfix-34414
Wraith2 9c2a700
Merge remote-tracking branch 'dotnet/master' into sqlfix-34414
Wraith2 a15c350
address feedback
Wraith2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
Isn't the result of AppendQuotedString same value as resultString.ToString()?
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.
The output is the same, The new path doesn't allocate a second stringbuilder or a string for that segment it just writes everything to the stringbuilder, That also allows the replace call to avoid a string allocation because it can be done in the internal buffer.
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.
My idea was that BuildQuotedString method can look like this:
`internal static string BuildQuotedString(string quotePrefix, string quoteSuffix, string unQuotedString)
{
var resultString = new StringBuilder(unQuotedString.Length + quoteSuffix.Length + quoteSuffix.Length);
But maybe I don't see something.
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.
It could but that would change AppendQuotedString to be allocating when there's no need to. If you want to produce a multipart name you could call AppendQuotedString up to 4 times with . separators in between them. I chose to provide flexibility by having one method responsible for the lifetime of the builder and the other simply using it.