diff options
-rw-r--r-- | mssql/types/driver.cxx | 36 | ||||
-rw-r--r-- | pgsql/types/driver.cxx | 35 |
2 files changed, 69 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 ()); diff --git a/pgsql/types/driver.cxx b/pgsql/types/driver.cxx index 35b7278..79e624e 100644 --- a/pgsql/types/driver.cxx +++ b/pgsql/types/driver.cxx @@ -86,6 +86,41 @@ main (int argc, char* argv[]) assert (o == *o1); } + typedef pgsql::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 char array. // { |