diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-26 15:48:28 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-26 15:48:28 +0200 |
commit | 61fc247f34255796f5535b52626074b4f92b6bb4 (patch) | |
tree | 347d00cedcee85f7d75a5976a210ab07ef33c7be /odb/mysql/statement.hxx | |
parent | ba8430c002627705d559b5dd9d78ae7611476520 (diff) |
Postpone fetching of the data for cached results
This way if an object of the same type is loaded in between iteration, the fetched
image won't be messed up.
Diffstat (limited to 'odb/mysql/statement.hxx')
-rw-r--r-- | odb/mysql/statement.hxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/odb/mysql/statement.hxx b/odb/mysql/statement.hxx index 343595d..5ff0a4e 100644 --- a/odb/mysql/statement.hxx +++ b/odb/mysql/statement.hxx @@ -76,8 +76,21 @@ namespace odb return cached_; } + // Can only be called on a cached result. + // + std::size_t + result_size () const + { + return size_; + } + + // Number of rows already fetched. + // std::size_t - result_size (); + fetched () const + { + return rows_; + } result fetch (); @@ -99,6 +112,7 @@ namespace odb bool end_; bool cached_; std::size_t rows_; + std::size_t size_; binding& cond_; std::size_t cond_version_; |