Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
V0.2.5 - Fixed ResultSet::with_row_type bug where the handle was not …
Browse files Browse the repository at this point in the history
…moved correctly
  • Loading branch information
bobozaur committed Apr 4, 2022
1 parent 9cde5f0 commit aa21f0d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "exasol"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
authors = ["bobozaur"]
description = "Exasol client library implemented in Rust."
Expand Down
4 changes: 2 additions & 2 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
/// # let password = env::var("EXA_PASSWORD").unwrap();
/// #
/// let mut exa_con = connect(&dsn, &schema, &user, &password).unwrap();
/// let result = exa_con.execute("SELECT 1, 2 UNION ALL SELECT 1, 2;").unwrap();
/// let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST LIMIT 1500;").unwrap();
///
/// if let QueryResult::ResultSet(result_set) = result {
/// // Change the expected row type with the turbofish notation
Expand All @@ -194,7 +194,7 @@ where
total_rows_pos: self.total_rows_pos,
chunk_rows_num: self.chunk_rows_num,
chunk_rows_pos: self.chunk_rows_pos,
result_set_handle: self.result_set_handle,
result_set_handle: std::mem::take(&mut self.result_set_handle),
columns: std::mem::take(&mut self.columns),
data_iter: std::mem::replace(&mut self.data_iter, vec![].into_iter()),
connection: Rc::clone(&self.connection),
Expand Down
9 changes: 5 additions & 4 deletions tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ mod tests {
let password = env::var("EXA_PASSWORD").unwrap();

let mut exa_con = connect(&dsn, &schema, &user, &password).unwrap();
let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST;").unwrap();
let result = exa_con.execute("SELECT * FROM EXA_RUST_TEST LIMIT 2001;").unwrap();

if let QueryResult::ResultSet(mut r) = result {
let x = r.next();
println!("{:?}", x);
let result_set = ResultSet::try_from(result).unwrap().with_row_type::<Vec<Value>>();
let result_set = result_set;
for row in result_set {
println!("{:?}", row.unwrap());
}

use std::time::Instant;
Expand Down

0 comments on commit aa21f0d

Please sign in to comment.