diff options
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r-- | common/query/driver.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx index 6afd82d..c207955 100644 --- a/common/query/driver.cxx +++ b/common/query/driver.cxx @@ -513,6 +513,25 @@ main (int argc, char* argv[]) t.commit (); } + + // Test empty result set. + // + cout << "test 018" << endl; + { + { + transaction t (db->begin ()); + result r (db->query<person> (query::last_name == "None")); + assert (r.empty ()); + t.commit (); + } + + { + transaction t (db->begin ()); + result r (db->query<person> (query::last_name == "None")); + assert (r.begin () == r.end ()); + t.commit (); + } + } } catch (const odb::exception& e) { |