diff options
Diffstat (limited to 'mssql')
-rw-r--r-- | mssql/types/driver.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/mssql/types/driver.cxx b/mssql/types/driver.cxx index 09e13c5..90f9708 100644 --- a/mssql/types/driver.cxx +++ b/mssql/types/driver.cxx @@ -130,11 +130,43 @@ main (int argc, char* argv[]) assert (o == *o1); } - // Test short/long data in queries. - // typedef mssql::query<object> query; typedef odb::result<object> result; + // Test UUID in queries. + // + { + char uuid[16]; + memcpy (uuid, o.uuid_, 16); + + transaction t (db->begin ()); + + { + result r (db->query<object> (query::uuid == uuid)); + assert (size (r) == 1); + } + + { + result r (db->query<object> (query::uuid == query::_val (uuid))); + assert (size (r) == 1); + } + + { + result r (db->query<object> (query::uuid == query::_ref (uuid))); + assert (size (r) == 1); + } + + { + const char* d (uuid); + result r (db->query<object> (query::uuid == d)); + assert (size (r) == 1); + } + + t.commit (); + } + + // Test short/long data in queries. + // { transaction t (db->begin ()); |