From eb634165b913d54c9b49f51392947db5c19528cd Mon Sep 17 00:00:00 2001 From: SilverFox Date: Mon, 27 Jul 2020 21:13:53 +0800 Subject: [PATCH] Only check inexact match when no exact match is found. Fix #39620 --- .../Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs | 2 +- .../src/System/Data/ProviderBase/DbMetaDataFactory.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs b/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs index 3a12fa546dfa5..103eeff8312c5 100644 --- a/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs +++ b/src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs @@ -278,7 +278,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/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs index 68892d670c3c1..5a764bae10b26 100644 --- a/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs +++ b/src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs @@ -303,7 +303,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)