From 7adf3d7aebbdea54f83a3654182cc9aafd4a8b41 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 8 Oct 2012 11:56:00 +0200 Subject: More query result size() fixes --- common/query/driver.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'common/query') 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 (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 (query::last_name == "None")); assert (r.size () == 0); for (result::iterator i (r.begin ()); i != r.end (); ++i) ; -- cgit v1.1