From eb20ad512d29475ebf81ae43bca362d40ab3fba2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 5 Oct 2012 10:58:38 +0200 Subject: Fix bug in short national char data querying --- mssql/types/driver.cxx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'mssql') diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 3f5577f..cd5523d 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -127,6 +127,37 @@ main (int argc, char* argv[]) assert (o == *o1); } + + // Test short/long data in queries. + // + typedef odb::query query; + typedef odb::result result; + + { + transaction t (db->begin ()); + + { + result r (db->query (query::svchar == o.svchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::snvchar == o.snvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mvchar == o.mvchar_)); + assert (size (r) == 1); + } + + { + result r (db->query (query::mnvchar == o.mnvchar_)); + assert (size (r) == 1); + } + + t.commit (); + } } // Test long NULL data. -- cgit v1.1