diff options
Diffstat (limited to 'common/query')
-rw-r--r-- | common/query/driver.cxx | 19 | ||||
-rw-r--r-- | common/query/test.std | 1 |
2 files changed, 20 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) { diff --git a/common/query/test.std b/common/query/test.std index 58a2aa0..e4ed7a0 100644 --- a/common/query/test.std +++ b/common/query/test.std @@ -98,3 +98,4 @@ Jane Doe 29 married test 016 test 017 +test 018 |