File tree Expand file tree Collapse file tree 5 files changed +11
-22
lines changed
Provider/src/FirebirdSql.Data.FirebirdClient Expand file tree Collapse file tree 5 files changed +11
-22
lines changed Original file line number Diff line number Diff line change @@ -286,11 +286,7 @@ public override void Execute()
286286 var executeResponse = _database . ReadResponse < GenericResponse > ( ) ;
287287 ProcessExecuteResponse ( executeResponse ) ;
288288
289- if ( ReturnRecordsAffected &&
290- ( StatementType == DbStatementType . Insert ||
291- StatementType == DbStatementType . Delete ||
292- StatementType == DbStatementType . Update ||
293- StatementType == DbStatementType . StoredProcedure ) )
289+ if ( DoRecordsAffected )
294290 {
295291 SendInfoSqlToBuffer ( RowsAffectedInfoItems , IscCodes . ROWS_AFFECTED_BUFFER_SIZE ) ;
296292 _database . XdrStream . Flush ( ) ;
Original file line number Diff line number Diff line change @@ -115,12 +115,7 @@ public override void Execute()
115115 SendExecuteToBuffer ( ) ;
116116
117117 var readRowsAffectedResponse = false ;
118- if ( ReturnRecordsAffected &&
119- ( StatementType == DbStatementType . Insert ||
120- StatementType == DbStatementType . Delete ||
121- StatementType == DbStatementType . Update ||
122- StatementType == DbStatementType . StoredProcedure ||
123- StatementType == DbStatementType . Select ) )
118+ if ( DoRecordsAffected )
124119 {
125120 SendInfoSqlToBuffer ( RowsAffectedInfoItems , IscCodes . ROWS_AFFECTED_BUFFER_SIZE ) ;
126121
Original file line number Diff line number Diff line change @@ -80,12 +80,7 @@ public override void Execute()
8080
8181 // we need to split this in two, to allow server handle op_cancel properly
8282
83- if ( ReturnRecordsAffected &&
84- ( StatementType == DbStatementType . Insert ||
85- StatementType == DbStatementType . Delete ||
86- StatementType == DbStatementType . Update ||
87- StatementType == DbStatementType . StoredProcedure ||
88- StatementType == DbStatementType . Select ) )
83+ if ( DoRecordsAffected )
8984 {
9085 SendInfoSqlToBuffer ( RowsAffectedInfoItems , IscCodes . ROWS_AFFECTED_BUFFER_SIZE ) ;
9186
Original file line number Diff line number Diff line change @@ -620,11 +620,7 @@ private void Allocate()
620620
621621 private void UpdateRecordsAffected ( )
622622 {
623- if ( ReturnRecordsAffected &&
624- ( StatementType == DbStatementType . Insert ||
625- StatementType == DbStatementType . Delete ||
626- StatementType == DbStatementType . Update ||
627- StatementType == DbStatementType . StoredProcedure ) )
623+ if ( DoRecordsAffected )
628624 {
629625 _recordsAffected = GetRecordsAffected ( ) ;
630626 }
Original file line number Diff line number Diff line change @@ -96,6 +96,13 @@ internal abstract class StatementBase : IDisposable
9696 public abstract int FetchSize { get ; set ; }
9797 public abstract bool ReturnRecordsAffected { get ; set ; }
9898
99+ public bool DoRecordsAffected => ReturnRecordsAffected
100+ && ( StatementType == DbStatementType . Insert
101+ || StatementType == DbStatementType . Delete
102+ || StatementType == DbStatementType . Update
103+ || StatementType == DbStatementType . StoredProcedure
104+ || StatementType == DbStatementType . Select ) ;
105+
99106 #endregion
100107
101108 #region IDisposable methods
You can’t perform that action at this time.
0 commit comments