File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
src/MySqlConnector/MySqlClient/Results Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public async Task<ResultSet> ReadResultSetHeaderAsync(IOBehavior ioBehavior)
40
40
if ( firstByte == OkPayload . Signature )
41
41
{
42
42
var ok = OkPayload . Create ( payload ) ;
43
- RecordsAffected = ok . AffectedRowCount ;
43
+ RecordsAffected + = ok . AffectedRowCount ;
44
44
LastInsertId = ok . LastInsertId ;
45
45
ColumnDefinitions = null ;
46
46
State = ( ok . ServerStatus & ServerStatus . MoreResultsExist ) == 0
Original file line number Diff line number Diff line change @@ -36,6 +36,29 @@ public async Task LastInsertedId()
36
36
}
37
37
}
38
38
39
+ [ Fact ]
40
+ public async Task RowsAffected ( )
41
+ {
42
+ await m_database . Connection . ExecuteAsync ( @"drop table if exists insert_rows_affected;
43
+ create table insert_rows_affected(id integer not null primary key auto_increment, value text null);" ) ;
44
+
45
+ try
46
+ {
47
+ await m_database . Connection . OpenAsync ( ) ;
48
+ using ( var command = new MySqlCommand ( @"
49
+ INSERT INTO insert_rows_affected (value) VALUES (null);
50
+ INSERT INTO insert_rows_affected (value) VALUES (null);" , m_database . Connection ) )
51
+ {
52
+ var rowsAffected = await command . ExecuteNonQueryAsync ( ) ;
53
+ Assert . Equal ( 2 , rowsAffected ) ;
54
+ }
55
+ }
56
+ finally
57
+ {
58
+ m_database . Connection . Close ( ) ;
59
+ }
60
+ }
61
+
39
62
[ Fact ]
40
63
public void LastInsertedIdExplicitStart ( )
41
64
{
You can’t perform that action at this time.
0 commit comments