From 68935dcecf0281924a18fe72bea495167de06c9d Mon Sep 17 00:00:00 2001 From: SilverFox Date: Mon, 27 Jul 2020 21:44:00 +0800 Subject: [PATCH] Only check inexact match when no exact match is found. Fix dotnet/runtime#39620 --- .../Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs | 2 +- .../netfx/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs index d8d9d21957..88ca0725c2 100644 --- a/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs +++ b/src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs @@ -283,7 +283,7 @@ internal DataRow FindMetaDataCollectionRow(string collectionName) exactCollectionName = candidateCollectionName; haveExactMatch = true; } - else + else if (haveExactMatch == false) { // have an inexact match - ok only if it is the only one if (exactCollectionName != null) diff --git a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs index 644d336232..bea2e6cae5 100644 --- a/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs +++ b/src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/ProviderBase/DbMetaDataFactory.cs @@ -322,7 +322,7 @@ internal DataRow FindMetaDataCollectionRow(string collectionName) exactCollectionName = candidateCollectionName; haveExactMatch = true; } - else + else if (haveExactMatch == false) { // have an inexact match - ok only if it is the only one if (exactCollectionName != null)