From 5856e0826de7c40653fcf60d0da3fd625bbe6bcb Mon Sep 17 00:00:00 2001 From: lajones Date: Thu, 18 Dec 2014 13:40:06 -0800 Subject: [PATCH] Fix for issue 2590. Revert changeset 6f4a59148c5c. I.e. remove interceptor that turned on DBCC 9481 flag. The flag could only be used by admin users and our queries have changed so the flag should no longer be necessary. --- ...toreSchemaGeneratorDatabaseSchemaLoader.cs | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/src/EFTools/EntityDesignerVersioningFacade/ReverseEngineerDb/SchemaDiscovery/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs b/src/EFTools/EntityDesignerVersioningFacade/ReverseEngineerDb/SchemaDiscovery/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs index b4b89809ae..9029096e52 100644 --- a/src/EFTools/EntityDesignerVersioningFacade/ReverseEngineerDb/SchemaDiscovery/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs +++ b/src/EFTools/EntityDesignerVersioningFacade/ReverseEngineerDb/SchemaDiscovery/EntityStoreSchemaGeneratorDatabaseSchemaLoader.cs @@ -5,11 +5,7 @@ namespace Microsoft.Data.Entity.Design.VersioningFacade.ReverseEngineerDb.Schema using System; using System.Collections.Generic; using System.Data; - using System.Data.Common; - using System.Data.Common.CommandTrees; using System.Data.Entity.Core.EntityClient; - using System.Data.Entity.Infrastructure.Interception; - using System.Data.Entity.Utilities; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -22,8 +18,6 @@ internal class EntityStoreSchemaGeneratorDatabaseSchemaLoader private readonly EntityConnection _connection; private readonly Version _storeSchemaModelVersion; - private const string ProviderNameSqlclient = "System.Data.SqlClient"; - public EntityStoreSchemaGeneratorDatabaseSchemaLoader(EntityConnection entityConnection, Version storeSchemaModelVersion) { Debug.Assert(entityConnection != null, "entityConnection != null"); @@ -34,31 +28,15 @@ public EntityStoreSchemaGeneratorDatabaseSchemaLoader(EntityConnection entityCon _storeSchemaModelVersion = storeSchemaModelVersion; } - internal class QueryTraceOn9481Interceptor : DbCommandInterceptor - { - [SuppressMessage("Microsoft.Security", "CA2100:Review SQL queries for security vulnerabilities", - Justification = "The only SQL passed to this method consists of pre-defined queries over which the user has no control")] - public override void ReaderExecuting(DbCommand command, DbCommandInterceptionContext interceptionContext) - { - // Enables the 9481 trace flag to deal with Sql Server 2014 performance regression - // See Codeplex #2445 - command.CommandText = command.CommandText + " OPTION (QUERYTRACEON 9481)"; - base.ReaderExecuting(command, interceptionContext); - } - } - // virtual for testing public virtual StoreSchemaDetails LoadStoreSchemaDetails(IList filters) { Debug.Assert(filters != null, "filters != null"); - QueryTraceOn9481Interceptor interceptor = null; try { _connection.Open(); - interceptor = CreateAndRegisterTrace9481InterceptorIfSqlServer(); - return new StoreSchemaDetails( LoadTableDetails(filters), LoadViewDetails(filters), @@ -70,30 +48,10 @@ public virtual StoreSchemaDetails LoadStoreSchemaDetails(IList LoadTableDetails(IEnumerable filters)