aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/no-id-object-result.txx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/pgsql/no-id-object-result.txx')
-rw-r--r--odb/pgsql/no-id-object-result.txx9
1 files changed, 6 insertions, 3 deletions
diff --git a/odb/pgsql/no-id-object-result.txx b/odb/pgsql/no-id-object-result.txx
index 98e1b48..6b1e921 100644
--- a/odb/pgsql/no-id-object-result.txx
+++ b/odb/pgsql/no-id-object-result.txx
@@ -25,7 +25,8 @@ namespace odb
statements_type& statements)
: base_type (statements.connection ().database ()),
statement_ (statement),
- statements_ (statements)
+ statements_ (statements),
+ count_ (0)
{
}
@@ -76,7 +77,9 @@ namespace odb
{
this->current (pointer_type ());
- if (!statement_->next ())
+ if (statement_->next ())
+ count_++;
+ else
{
statement_->free_result ();
this->end_ = true;
@@ -93,7 +96,7 @@ namespace odb
std::size_t no_id_object_result_impl<T>::
size ()
{
- return statement_->result_size ();
+ return this->end_ ? count_ : statement_->result_size ();
}
}
}