[GA] Ensure case-insensitive parameter name uniqueness #36922
Merged
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.
Fixes #36917
Description
#35113 (merged earlier in 10) simplifies EF's SQL parameter names; among other things, it performs uniquification (ensuring that parameters have unique names) only when needed, rather than the previous approach which always added suffixes to prevent clashes (and had issues).
However, the code currently considers parameter names to be the same - and thus in need of uniquification - only when they're case-sensitive-equal; if two parameter names are the same *except for case differences, they're considered different and are therefore not uniquified. Since some databases (e.g. SQL Server) are case-insensitive, this causes the query to fail as it contains two parameters with the "same" name.
Customer impact
LINQ queries which involve two parameters that have the same name except for case differences fail.
How found
Customer reported.
Regression
Yes, from 9.
Testing
Added.
Risk
Very low, one-line targeted change to code already changed earlier in 10.