aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-10-08 11:56:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-10-08 11:56:00 +0200
commit7adf3d7aebbdea54f83a3654182cc9aafd4a8b41 (patch)
treeeb1b1b3db096f0b8c4986d89b38aac7e0a4d3126 /common
parenteb20ad512d29475ebf81ae43bca362d40ab3fba2 (diff)
More query result size() fixes
Diffstat (limited to 'common')
-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) ;