Skip to content

Commit

Permalink
eliminate one use of SingleColumnRowSetBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Sep 5, 2022
1 parent 4721fd0 commit 739d30b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions odbc-api/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use common::{cursor_to_string, Profile, SingleColumnRowSetBuffer, ENV};

use odbc_api::{
buffers::{
BufferDescription, BufferKind, ColumnarAnyBuffer, Indicator, Item, TextColumn, TextRowSet,
BufferDescription, BufferKind, ColumnarAnyBuffer, ColumnarBuffer, Indicator, Item,
TextColumn, TextRowSet,
},
handles::{OutputStringBuffer, Statement},
parameter::InputParameter,
Expand Down Expand Up @@ -363,12 +364,15 @@ fn bind_char_to_wchar(profile: &Profile) {

let sql = format!("SELECT a FROM {};", table_name);
let cursor = conn.execute(&sql, ()).unwrap().unwrap();
let mut buf = SingleColumnRowSetBuffer::with_wide_text_column(1, 5);
let mut buf = ColumnarBuffer::new(vec![(1, TextColumn::<u16>::new(1, 5))]);
let mut row_set_cursor = cursor.bind_buffer(&mut buf).unwrap();
row_set_cursor.fetch().unwrap();
drop(row_set_cursor);

assert_eq!(Some(U16String::from_str("Hello").as_ustr()), buf.ustr_at(0));
assert_eq!(
Some(U16String::from_str("Hello").as_ustr()),
buf.column(0).get(0).map(U16Str::from_slice)
);
}

/// Bind a BIT column to a Bit buffer.
Expand Down

0 comments on commit 739d30b

Please sign in to comment.