From 293286a76754226f86b267571eef744e6994a1ad Mon Sep 17 00:00:00 2001 From: Lau Date: Sat, 2 May 2020 14:41:11 +0200 Subject: [PATCH] Fix minor bugs. --- .../JetStoreSchemaDefinitionRetrieve.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/System.Data.Jet/JetStoreSchemaDefinition/JetStoreSchemaDefinitionRetrieve.cs b/src/System.Data.Jet/JetStoreSchemaDefinition/JetStoreSchemaDefinitionRetrieve.cs index 8802f6c..53079f8 100644 --- a/src/System.Data.Jet/JetStoreSchemaDefinition/JetStoreSchemaDefinitionRetrieve.cs +++ b/src/System.Data.Jet/JetStoreSchemaDefinition/JetStoreSchemaDefinitionRetrieve.cs @@ -33,17 +33,17 @@ namespace System.Data.Jet.JetStoreSchemaDefinition public static bool TryGetDataReaderFromShowCommand(DbCommand command, DbProviderFactory providerFactory, out DbDataReader dataReader) { - if (command.CommandType == CommandType.Text && command.CommandText.Trim() - .StartsWith("show ", StringComparison.InvariantCultureIgnoreCase)) + if (command.CommandType == CommandType.Text && + command.CommandText.IndexOf("show ", StringComparison.OrdinalIgnoreCase) >= 0) { - dataReader = GetDbDataReaderFromSimpleStatement(command.Connection, command.CommandText); - lock (_lastStructureDataTableLock) - _lastTableName = null; - return true; - } + if (command.CommandText.Trim().StartsWith("show ", StringComparison.OrdinalIgnoreCase)) + { + dataReader = GetDbDataReaderFromSimpleStatement(command.Connection, command.CommandText); + lock (_lastStructureDataTableLock) + _lastTableName = null; + return true; + } - if (command.CommandType == CommandType.Text && command.CommandText.IndexOf("show ", 0, StringComparison.InvariantCultureIgnoreCase) != 0) - { bool isSchemaTable = false; foreach (SystemTable table in _systemTables) { @@ -63,6 +63,7 @@ namespace System.Data.Jet.JetStoreSchemaDefinition lock (_lastStructureDataTableLock) _lastTableName = null; + dataReader = null; return false; }