File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,13 @@ Non-breaking Changes:
11
11
12
12
* ` DbError::new() ` uses generics, which supports old types.
13
13
14
+ Internal Changes:
15
+
16
+ * Improve performance of iterator for [ ` ResultSet<T> ` ] [ `ResultSet` ] where T is [ ` Row ` ]
17
+ by sharing an internal fetch array buffer. Before this change, one row in the buffer
18
+ is copied to ` Row ` for each iteration. After this, new fetch array buffer is allocated
19
+ when more rows must be fetched into a buffer but the buffer is referenced by ` Row ` s.
20
+
14
21
## 0.6.0 (2024-05-20)
15
22
16
23
Breaking changes:
Original file line number Diff line number Diff line change @@ -1485,4 +1485,25 @@ mod tests {
1485
1485
1486
1486
Ok ( ( ) )
1487
1487
}
1488
+
1489
+ #[ test]
1490
+ fn fetch_rows_to_vec ( ) -> Result < ( ) > {
1491
+ let conn = test_util:: connect ( ) ?;
1492
+ // The fetch array size must be less than the number of rows in TestStrings
1493
+ // in order to make situation that a new fetch array buffer must allocated
1494
+ // in Stmt::fetch_rows().
1495
+ let mut stmt = conn
1496
+ . statement ( "select IntCol from TestStrings order by IntCol" )
1497
+ . fetch_array_size ( 3 )
1498
+ . build ( ) ?;
1499
+ let mut rows = Vec :: new ( ) ;
1500
+ for row_result in stmt. query ( & [ ] ) ? {
1501
+ rows. push ( row_result?) ;
1502
+ }
1503
+ for ( index, row) in rows. iter ( ) . enumerate ( ) {
1504
+ let int_col: usize = row. get ( 0 ) ?;
1505
+ assert_eq ! ( int_col, index + 1 ) ;
1506
+ }
1507
+ Ok ( ( ) )
1508
+ }
1488
1509
}
You can’t perform that action at this time.
0 commit comments