aboutsummaryrefslogtreecommitdiff
path: root/common/query/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/query/driver.cxx')
-rw-r--r--common/query/driver.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/common/query/driver.cxx b/common/query/driver.cxx
index 3c3c753..bec61fb 100644
--- a/common/query/driver.cxx
+++ b/common/query/driver.cxx
@@ -570,7 +570,7 @@ main (int argc, char* argv[])
result::iterator i (r.begin ());
++i;
++i;
- r.cache ();
+ r.cache (); // Cache in the middle.
assert (r.size () == 4);
++i;
assert (r.size () == 4);
@@ -580,6 +580,17 @@ main (int argc, char* argv[])
{
transaction t (db->begin ());
+ result r (db->query<person> (false));
+ result::iterator i (r.begin ());
+ ++i;
+ ++i;
+ ++i;
+ r.cache (); // Cache at the end.
+ assert (r.size () == 4);
+ }
+
+ {
+ transaction t (db->begin ());
result r (db->query<person> (query::last_name == "None"));
assert (r.size () == 0);
for (result::iterator i (r.begin ()); i != r.end (); ++i) ;