From c1726fd3dc61475a9b3ac58d62454fb1f2443caa Mon Sep 17 00:00:00 2001 From: Andriy Svyryd Date: Sun, 14 Nov 2021 14:53:35 -0800 Subject: [PATCH] Add quirk mode for #26632 --- .../Update/Internal/SqlServerUpdateSqlGenerator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs index 742244fcd03..c1db15b3489 100644 --- a/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs +++ b/src/EFCore.SqlServer/Update/Internal/SqlServerUpdateSqlGenerator.cs @@ -65,7 +65,9 @@ public virtual ResultSetMapping AppendBulkInsertOperation( modificationCommands[0], modificationCommands[0].ColumnModifications.Where(o => o.IsKey).ToList(), modificationCommands[0].ColumnModifications.Where(o => o.IsRead).ToList(), - commandPosition); + (!AppContext.TryGetSwitch("Microsoft.EntityFrameworkCore.Issue26632", out var enabled) || !enabled) + ? commandPosition + : 0); } var readOperations = modificationCommands[0].ColumnModifications.Where(o => o.IsRead).ToList();