File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ protected override int CountOfStatementsInCurrentBatch
3939
4040 public override void AddToBatch ( IExpectation expectation )
4141 {
42+ // MySql batcher cannot be initiated if a data reader is still open: check them.
43+ if ( CountOfStatementsInCurrentBatch == 0 )
44+ CheckReaders ( ) ;
45+
4246 totalExpectedRowsAffected += expectation . ExpectedRowCount ;
4347 var batchUpdate = CurrentCommand ;
4448 Prepare ( batchUpdate ) ;
Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ public partial class MySqlClientBatchingBatcher : AbstractBatcher
2424 public override async Task AddToBatchAsync ( IExpectation expectation , CancellationToken cancellationToken )
2525 {
2626 cancellationToken . ThrowIfCancellationRequested ( ) ;
27+ // MySql batcher cannot be initiated if a data reader is still open: check them.
28+ if ( CountOfStatementsInCurrentBatch == 0 )
29+ await ( CheckReadersAsync ( cancellationToken ) ) . ConfigureAwait ( false ) ;
30+
2731 totalExpectedRowsAffected += expectation . ExpectedRowCount ;
2832 var batchUpdate = CurrentCommand ;
2933 await ( PrepareAsync ( batchUpdate , cancellationToken ) ) . ConfigureAwait ( false ) ;
You can’t perform that action at this time.
0 commit comments