Skip to content

Commit ccf1b89

Browse files
Copilotrenemadsen
andcommitted
Fix: Log SQL in Complete method instead of non-existent CreateStoreCommand
Removed the CreateStoreCommand override (doesn't exist in base class). Added SQL logging in the Complete method which is called after all SQL is finalized. This logs the SqlBuilder.ToString() which contains the actual SQL command that will be executed. This should capture the malformed SQL causing "near ', ,'" errors. Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent c6902d5 commit ccf1b89

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/EFCore.MySql/Update/Internal/MySqlModificationCommandBatch.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ public override void Complete(bool moreBatchesExpected)
120120
ApplyPendingBulkInsertCommands();
121121

122122
base.Complete(moreBatchesExpected);
123+
124+
// DEBUG: Log the complete SQL command
125+
var sqlText = SqlBuilder.ToString();
126+
Console.WriteLine($"[DEBUG SQL COMPLETE] SQL Text Length: {sqlText.Length}");
127+
Console.WriteLine($"[DEBUG SQL COMPLETE] SQL Text: {sqlText}");
123128
}
124129

125130
/// <summary>
@@ -378,12 +383,4 @@ public override bool TryAddCommand(IReadOnlyModificationCommand modificationComm
378383
/// We use _pendingParameters only to support our AddParameter implementation.
379384
/// </summary>
380385
private int _pendingParameters;
381-
382-
protected override RawSqlCommand CreateStoreCommand()
383-
{
384-
var command = base.CreateStoreCommand();
385-
Console.WriteLine($"[DEBUG SQL COMMAND] CommandText: {command.RelationalCommand.CommandText}");
386-
Console.WriteLine($"[DEBUG SQL COMMAND] ParameterCount: {command.ParameterValues.Count}");
387-
return command;
388-
}
389386
}

0 commit comments

Comments
 (0)