Skip to content

Commit e0e8cf0

Browse files
authored
ExecuteUpdate: compare by alias, not by reference (#34601)
1 parent 29c055e commit e0e8cf0

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/EFCore.Relational/Query/QuerySqlGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ protected override Expression VisitUpdate(UpdateExpression updateExpression)
14721472
var table = selectExpression.Tables[i];
14731473
var joinExpression = table as JoinExpressionBase;
14741474

1475-
if (ReferenceEquals(updateExpression.Table, joinExpression?.Table ?? table))
1475+
if (updateExpression.Table.Alias == (joinExpression?.Table.Alias ?? table.Alias))
14761476
{
14771477
LiftPredicate(table);
14781478
continue;

test/EFCore.Sqlite.FunctionalTests/BulkUpdates/NonSharedModelBulkUpdatesSqliteTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ public override async Task Delete_aggregate_root_when_table_sharing_with_non_own
6363

6464
public override async Task Replace_ColumnExpression_in_column_setter(bool async)
6565
{
66-
// #33947
67-
await Assert.ThrowsAsync<SqliteException>(() => base.Replace_ColumnExpression_in_column_setter(async));
66+
await base.Replace_ColumnExpression_in_column_setter(async);
6867

6968
AssertSql(
7069
"""
@@ -73,7 +72,7 @@ public override async Task Replace_ColumnExpression_in_column_setter(bool async)
7372
UPDATE "OwnedCollection" AS "o0"
7473
SET "Value" = @p
7574
FROM "Owner" AS "o"
76-
INNER JOIN "OwnedCollection" AS "o0" ON "o"."Id" = "o0"."OwnerId"
75+
WHERE "o"."Id" = "o0"."OwnerId"
7776
""");
7877
}
7978

0 commit comments

Comments
 (0)