File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/MySqlConnector/MySqlClient/Results Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ Row ScanRowAsyncRemainder(PayloadData payload, Row row_)
228228 row_ . SetData ( m_dataLengths , m_dataOffsets , payload . ArraySegment ) ;
229229 m_rowBuffered = row_ ;
230230 m_hasRows = true ;
231+ BufferState = ResultSetState . ReadingRows ;
231232 return row_ ;
232233 }
233234 }
Original file line number Diff line number Diff line change @@ -830,6 +830,38 @@ public void HasRows(int[] values, bool[] expecteds)
830830 }
831831 }
832832
833+ [ Fact ]
834+ public void HasRowsRepeated ( )
835+ {
836+ m_database . Connection . Execute ( @"drop table if exists has_rows;
837+ create table has_rows(value int not null);
838+ insert into has_rows(value) values(1),(2),(3);" ) ;
839+
840+ using ( var cmd = m_database . Connection . CreateCommand ( ) )
841+ {
842+ cmd . CommandText = "select * from has_rows where value = 1;" ;
843+ using ( var reader = cmd . ExecuteReader ( ) )
844+ {
845+ Assert . True ( reader . HasRows ) ;
846+ Assert . True ( reader . HasRows ) ;
847+ Assert . True ( reader . HasRows ) ;
848+ Assert . True ( reader . HasRows ) ;
849+
850+ Assert . True ( reader . Read ( ) ) ;
851+
852+ Assert . True ( reader . HasRows ) ;
853+ Assert . True ( reader . HasRows ) ;
854+ Assert . True ( reader . HasRows ) ;
855+
856+ Assert . False ( reader . Read ( ) ) ;
857+
858+ Assert . True ( reader . HasRows ) ;
859+ Assert . True ( reader . HasRows ) ;
860+ Assert . True ( reader . HasRows ) ;
861+ }
862+ }
863+ }
864+
833865 class BoolTest
834866 {
835867 public int Id { get ; set ; }
You can’t perform that action at this time.
0 commit comments