From 427bd41ac7b27b419cd7917c66d3d2d18823eb22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=AF=97=E5=B3=A3?= Date: Sat, 16 Dec 2023 03:36:59 +0800 Subject: [PATCH] Fixed bug with "RETURNING" clause of EFCore --- EFCore/src/Update/MySQLUpdateSqlGenerator.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/EFCore/src/Update/MySQLUpdateSqlGenerator.cs b/EFCore/src/Update/MySQLUpdateSqlGenerator.cs index 3487e1cea..299871c56 100644 --- a/EFCore/src/Update/MySQLUpdateSqlGenerator.cs +++ b/EFCore/src/Update/MySQLUpdateSqlGenerator.cs @@ -551,6 +551,19 @@ internal enum ResultsGrouping } } + protected override void AppendReturningClause(StringBuilder commandStringBuilder, IReadOnlyList operations, string? additionalValues = null) + { + if (additionalValues is not null) + { + if (operations.Count > 0) + { + commandStringBuilder.Append(", "); + } + + commandStringBuilder.Append('1'); + } + } + private void AppendRowsAffectedWhereCondition(StringBuilder commandStringBuilder, int expectedRowsAffected) { Check.NotNull(commandStringBuilder, "commandStringBuilder");