Bug #82007 The method or operation is not implemented.
Submitted: 26 Jun 2016 18:47 Modified: 3 Jul 2016 20:05
Reporter: Harel Mazor Email Updates:
Status: Verified Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:6.9.8 OS:Microsoft Windows (Window 10)
Assigned to: CPU Architecture:Any

[26 Jun 2016 18:47] Harel Mazor
I have a model that I used with code first and created a schema, after that I migrated my SQL database from MSSQL.
When all was ready I tried to query the database but got the exception:
The method or operation is not implemented.
   at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree, DbInterceptionContext interceptionContext, IDbDependencyResolver resolver, BridgeDataReaderFactory bridgeDataReaderFactory, ColumnMapFactory columnMapFactory)
   at System.Data.Entity.Core.EntityClient.Internal.EntityProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.CreateCommandDefinition(ObjectContext context, DbQueryCommandTree tree)
   at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlanFactory.Prepare(ObjectContext context, DbQueryCommandTree tree, Type elementType, MergeOption mergeOption, Boolean streaming, Span span, IEnumerable`1 compiledQueryParameters, AliasGenerator aliasGenerator)
   at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)
   at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
   at System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
   at System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression)
   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
   at MySQLBugExample.Program.Main(String[] args) in D:\VisualStudio\MySQLBugExample\MySQLBugExample\Program.cs:line 12
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

How to repeat:
I'd like to attach a zip file with the relevant files but I don't see an option here.
I don't have time to try and reduce the problem to a simpler scenario.

Suggested fix:
Stop using MySQL and return to MSSQL...
[27 Jun 2016 9:17] Chiranjeevi Battula
Hello Harel Mazor,

Thank you for the bug report.
I could not repeat the issue at our end using with Visual Studio 2013, Connector/NET 6.9.8 and with your example.
Could you please provide repeatable test case (steps, sample code etc. - please make it as private if you prefer) to confirm this issue at our end?

[27 Jun 2016 9:18] Chiranjeevi Battula

Attachment: 82007.txt (text/plain), 38.40 KiB.

[27 Jun 2016 18:03] Harel Mazor

I have added another file, almost identical to the previous.
Steps to reproduce:
1. Change the connection string to a local instance.
2. Press F5 to run the program - this code should start by creating the needed tables in the database and continue by querying them.

I'm using vs 2015 community with amazon RDS MySQL server.
If you are still unable to reproduce it I'll try and send you my connection string to see if this is an issue with the database somehow.
If this doesn't work please advise how to show you the bug as I don't have any problems reproducing it.
[28 Jun 2016 6:11] Chiranjeevi Battula
Hello Harel Mazor,

Thank you for your feedback and test case.
Verified this behavior on MySQL Connector/NET 6.9.8.

[28 Jun 2016 6:11] Chiranjeevi Battula

Attachment: 82007.JPG (image/jpeg, text), 358.16 KiB.

[28 Jun 2016 23:18] Harel Mazor
If you manage to fix this issue please try the following LINQ query since I think it gave me an exception with a different stack trace (something with visitor):

var emails = new [] { "email1", "email2" };
var company = new Company { Id = 1 };
var affiliates = databaseContext.GetFullAffiliates().Where(a => emails.Contains(a.EMail.ToLower()) && a.Company.Id == company.Id).ToList();

Please let me know if you need me to open another bug on that matter.
[3 Jul 2016 20:05] Harel Mazor
Are you guys planning on fixing this bug?
I can't use EF with MySQL due to this issue so I can't migrate my MSSQL database.
Is there a planned version with this bug fix any time soon?

Harel M.