Skip to content

Commit f41ba13

Browse files
committed
Stop sending final MySqlRowsCopied event.
This was a workaround for the lack of a RowsCopied property, which will be added.
1 parent c45f2c1 commit f41ba13

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

src/MySqlConnector/MySql.Data.MySqlClient/MySqlBulkCopy.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,6 @@ await m_valuesEnumerator.MoveNextAsync().ConfigureAwait(false) :
283283
var payload2 = new PayloadData(new ArraySegment<byte>(buffer, 0, outputIndex));
284284
await m_connection.Session.SendReplyAsync(payload2, ioBehavior, cancellationToken).ConfigureAwait(false);
285285
}
286-
287-
// send final RowsCopied event (if it wasn't already sent)
288-
if (eventArgs is object && rowsCopied % NotifyAfter != 0)
289-
{
290-
eventArgs.RowsCopied = rowsCopied;
291-
MySqlRowsCopied!(this, eventArgs);
292-
}
293286
}
294287
finally
295288
{

tests/SideBySide/BulkLoaderAsync.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,8 @@ public async Task BulkLoadDataTableWithTooLongData()
506506
[Theory]
507507
[InlineData(0, 15, 0, 0)]
508508
[InlineData(5, 15, 3, 15)]
509-
[InlineData(5, 16, 4, 16)]
510-
[InlineData(int.MaxValue, 15, 1, 15)]
509+
[InlineData(5, 16, 3, 15)]
510+
[InlineData(int.MaxValue, 0, 0, 0)]
511511
public async Task BulkCopyNotifyAfter(int notifyAfter, int rowCount, int expectedEventCount, int expectedRowsCopied)
512512
{
513513
using var connection = new MySqlConnection(GetLocalConnectionString());
@@ -547,7 +547,7 @@ public async Task BulkCopyNotifyAfter(int notifyAfter, int rowCount, int expecte
547547
[InlineData(0, 40, 0, 0, 0, 40)]
548548
[InlineData(5, 40, 15, 3, 15, 0)]
549549
[InlineData(5, 40, 20, 4, 20, 16)]
550-
[InlineData(int.MaxValue, 20, 0, 1, 20, 20)]
550+
[InlineData(int.MaxValue, 20, 0, 0, 0, 20)]
551551
public async Task BulkCopyAbort(int notifyAfter, int rowCount, int abortAfter, int expectedEventCount, int expectedRowsCopied, long expectedCount)
552552
{
553553
using var connection = new MySqlConnection(GetLocalConnectionString());

tests/SideBySide/BulkLoaderSync.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,8 @@ public void BulkLoadDataTableWithTooLongString()
702702
[Theory]
703703
[InlineData(0, 15, 0, 0)]
704704
[InlineData(5, 15, 3, 15)]
705-
[InlineData(5, 16, 4, 16)]
706-
[InlineData(int.MaxValue, 15, 1, 15)]
705+
[InlineData(5, 16, 3, 15)]
706+
[InlineData(int.MaxValue, 0, 0, 0)]
707707
public void BulkCopyNotifyAfter(int notifyAfter, int rowCount, int expectedEventCount, int expectedRowsCopied)
708708
{
709709
using var connection = new MySqlConnection(GetLocalConnectionString());
@@ -743,7 +743,7 @@ public void BulkCopyNotifyAfter(int notifyAfter, int rowCount, int expectedEvent
743743
[InlineData(0, 40, 0, 0, 0, 40)]
744744
[InlineData(5, 40, 15, 3, 15, 0)]
745745
[InlineData(5, 40, 20, 4, 20, 16)]
746-
[InlineData(int.MaxValue, 20, 0, 1, 20, 20)]
746+
[InlineData(int.MaxValue, 20, 0, 0, 0, 20)]
747747
public void BulkCopyAbort(int notifyAfter, int rowCount, int abortAfter, int expectedEventCount, int expectedRowsCopied, long expectedCount)
748748
{
749749
using var connection = new MySqlConnection(GetLocalConnectionString());

0 commit comments

Comments
 (0)