You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public DbSet<SyncRunItem> SyncRunItems { get; set; } = null!;
public DbSet<SomethingPlatformPart> SomethingPlatformParts{ get; set; } = null!;
public class SomethingPlatformPart
{
public Guid SyncRunItemId { get; set; }
public SyncRunItem SyncRunItem { get; set; }
}
public class SyncRunItem
{
public DateTime StartDate { get; set; }
}
dbContext.SomethingPlatformParts
.Where(x => x.SyncRunItem.StartDate < addMonths)
.Take(100 * 1000)
.ExecuteDeleteAsync();
The issue
ExecuteDeleteAsync in combination with Take doesn't work
Message:
System.InvalidOperationException : The operation 'ExecuteDelete' contains a select expression feature that isn't supported in the query SQL generator, but has been declared as supported by provider during translation phase. This is a bug in your EF Core provider, please file an issue.
Stack Trace:
MySqlQuerySqlGenerator.VisitDelete(DeleteExpression deleteExpression)
QuerySqlGenerator.GenerateRootCommand(Expression queryExpression)
QuerySqlGenerator.GetCommand(Expression queryExpression)
RelationalCommandCache.GetRelationalCommandTemplate(IReadOnlyDictionary`2 parameters)
RelationCommandCacheExtensions.RentAndPopulateRelationalCommand(RelationalCommandCache relationalCommandCache, RelationalQueryContext queryContext)
<>c.<NonQueryResultAsync>b__14_0(DbContext _, ValueTuple`3 state, CancellationToken cancellationToken)
MySqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
Further technical details
MySQL version:
Operating system: windows (dev machine) & linux containers
Pomelo.EntityFrameworkCore.MySql version: 8.02
Microsoft.AspNetCore.App version: 8
Other details about my project setup: works for other database providers like sqlLite, there the generated SQL is in the form of:
DELETE FROM "SomethingPlatformParts" AS "s"
WHERE "s"."SomethingPlatformPartId" IN (
SELECT "s0"."SomethingPlatformPartId"
FROM "SomethingPlatformParts" AS "s0"
INNER JOIN "SyncRunItems" AS "s1" ON "s0"."SyncRunItemId" = "s1"."Id"
WHERE "s1"."StartDate" < @__refMonth_0
LIMIT @__p_1
)
The text was updated successfully, but these errors were encountered:
Steps to reproduce
The issue
ExecuteDeleteAsync in combination with Take doesn't work
Further technical details
MySQL version:
Operating system: windows (dev machine) & linux containers
Pomelo.EntityFrameworkCore.MySql version: 8.02
Microsoft.AspNetCore.App version: 8
Other details about my project setup: works for other database providers like sqlLite, there the generated SQL is in the form of:
The text was updated successfully, but these errors were encountered: