File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
FirebirdSql.Data.FirebirdClient.Tests
FirebirdSql.Data.FirebirdClient/FirebirdClient 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()
844844 }
845845 }
846846
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+
847858 #endregion
848859 }
849860}
Original file line number Diff line number Diff line change @@ -463,7 +463,13 @@ public override int ExecuteNonQuery()
463463 throw ;
464464 }
465465
466- return RecordsAffected ;
466+ return _statement . StatementType switch
467+ {
468+ DbStatementType . Insert => RecordsAffected ,
469+ DbStatementType . Update => RecordsAffected ,
470+ DbStatementType . Delete => RecordsAffected ,
471+ _ => - 1 ,
472+ } ;
467473 }
468474
469475 public new FbDataReader ExecuteReader ( ) => ExecuteReader ( CommandBehavior . Default ) ;
You can’t perform that action at this time.
0 commit comments