Skip to content

Commit

Permalink
row count in safe code
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Aug 24, 2022
1 parent b45ebd8 commit b5e97a5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions odbc-api/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3313,13 +3313,10 @@ fn row_count_one_shot_query(profile: &Profile) {
let insert = format!("INSERT INTO {table_name} (a) VALUES (1), (2)");

// When
let preallocated = conn.preallocate().unwrap();
let mut stmt = preallocated.into_statement();
let row_count;
unsafe {
stmt.exec_direct(&SqlText::new(&insert)).unwrap();
row_count = stmt.row_count().unwrap();
}
let mut preallocated = conn.preallocate().unwrap();
preallocated.execute(&insert, ()).unwrap();
let stmt = preallocated.into_statement();
let row_count = stmt.row_count().unwrap();

// Then
assert_eq!(2, row_count);
Expand Down

0 comments on commit b5e97a5

Please sign in to comment.