-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Strange logic in System.Data.ProviderBase.DbMetaDataFactory.FindMetaDataCollectionRow() #39620
Labels
Milestone
Comments
Dotnet-GitSync-Bot
added
area-System.Data
untriaged
New issue has not been triaged by the area owner
labels
Jul 20, 2020
Tagging subscribers to this area: @roji, @ajcvickers |
I agree this seems like a bug... @ajcvickers? |
ajcvickers
removed
the
untriaged
New issue has not been triaged by the area owner
label
Jul 20, 2020
@yyjdelete are you interested in submitting a PR to fix this? |
yyjdelete
added a commit
to yyjdelete/runtime
that referenced
this issue
Jul 27, 2020
yyjdelete
added a commit
to yyjdelete/SqlClient
that referenced
this issue
Jul 27, 2020
cheenamalhotra
pushed a commit
to dotnet/SqlClient
that referenced
this issue
Aug 7, 2020
ghost
locked as resolved and limited conversation to collaborators
Dec 8, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
runtime/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
Lines 225 to 314 in 6072e4d
Seems the code here want to do an case-sensitive match first, and fallback to an case-insensitive match, and throw if get more than one matches(in case-sensitive or case-insensitive).
But if it first hit an case-sensitive match, and then some case-insensitive match, var
requestedCollectionRow
will be overwrite by the last case-insensitive match, but won't throwAmbigousCollectionName
sincehaveExactMatch
is true, and finally return the case-insensitive result instead of the extra match one.runtime/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
Line 280 in 6072e4d
Is it the expected logic? Maybe it should be
else if (!haveExactMatch)
here instead?Regression?
No. And didn't hit any problem with this, just found this when do some research for the behavior of
DbConnection.GetScmema()
.Other information
Note: There is also some copy of this file in OleDb and MD.SqlClient, which have the same problem.
https://github.com/dotnet/runtime/search?q=FindMetaDataCollectionRow&unscoped_q=FindMetaDataCollectionRow
https://github.com/dotnet/sqlclient/search?q=FindMetaDataCollectionRow&unscoped_q=FindMetaDataCollectionRow
The text was updated successfully, but these errors were encountered: