Skip to content

Commit

Permalink
improved prefetch test
Browse files Browse the repository at this point in the history
  • Loading branch information
huwwynnjones committed Jun 29, 2018
1 parent 505e7f0 commit 03c3d4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,10 @@ mod tests {
panic!("{}", err)
}

if let Err(err) = select.set_prefetch(5) {
panic!("{}", err)
}

let result_set = match select.result_set() {
Ok(res) => res,
Err(err) => panic!("{}", err),
Expand Down
4 changes: 3 additions & 1 deletion src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,12 @@ impl<'conn> Statement<'conn> {
///
pub fn set_prefetch(&mut self, nmb_of_rows: i32) -> Result<(), OciError> {
let size: c_uint = 0;
let rows: c_uint = nmb_of_rows as c_uint;
let rows_ptr: *const c_uint = &rows;
set_handle_attribute(
self.statement as *mut c_void,
HandleType::Statement,
nmb_of_rows as *mut c_void,
rows_ptr as *mut c_void,
size,
AttributeType::PrefetchRows,
self.connection.error(),
Expand Down

0 comments on commit 03c3d4f

Please sign in to comment.