Skip to content

Commit

Permalink
fix: increment the cursor position
Browse files Browse the repository at this point in the history
Once a row is delivered, we should increment the offset.
  • Loading branch information
abcpro1 committed Sep 15, 2023
1 parent c64a676 commit cea84e6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ fn exec_iter(pool: Pool, query: String) -> ExecIter {
let schema_ref = schema.clone();

let mut generator: Gen<Vec<Field>, (), _> = gen!({
let cursor_position = 0u64;
let mut cursor_position = 0u64;
'retry: loop {
let conn = pool.get_conn().map_err(QueryError)?;
{
Expand Down Expand Up @@ -515,6 +515,7 @@ fn exec_iter(pool: Pool, query: String) -> ExecIter {
let fields =
get_fields_from_cursor(cursor, cols, schema.borrow().as_deref().unwrap())?;
yield_!(fields);
cursor_position += 1;
}
}
conn.return_();
Expand Down

0 comments on commit cea84e6

Please sign in to comment.