File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
FirebirdSql.Data.FirebirdClient/FirebirdClient
FirebirdSql.Data.FirebirdClient.Tests Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -844,6 +844,17 @@ public void PassesDateTimeWithProperPrecision()
844
844
}
845
845
}
846
846
847
+ [ Test ]
848
+ public void ExecuteNonQueryReturnsMinusOneOnNonInsertUpdateDelete ( )
849
+ {
850
+ using ( var cmd = Connection . CreateCommand ( ) )
851
+ {
852
+ cmd . CommandText = "select 1 from rdb$database" ;
853
+ var ra = cmd . ExecuteNonQuery ( ) ;
854
+ Assert . AreEqual ( - 1 , ra ) ;
855
+ }
856
+ }
857
+
847
858
#endregion
848
859
}
849
860
}
Original file line number Diff line number Diff line change @@ -463,7 +463,13 @@ public override int ExecuteNonQuery()
463
463
throw ;
464
464
}
465
465
466
- return RecordsAffected ;
466
+ return _statement . StatementType switch
467
+ {
468
+ DbStatementType . Insert => RecordsAffected ,
469
+ DbStatementType . Update => RecordsAffected ,
470
+ DbStatementType . Delete => RecordsAffected ,
471
+ _ => - 1 ,
472
+ } ;
467
473
}
468
474
469
475
public new FbDataReader ExecuteReader ( ) => ExecuteReader ( CommandBehavior . Default ) ;
You can’t perform that action at this time.
0 commit comments