no-id-object-result.txx | no-id-object-result.txx | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
object_traits::init (obj, statements_.image (), &db); | object_traits::init (obj, statements_.image (), &db); | |||
object_traits::callback (db, obj, callback_event::post_load); | object_traits::callback (db, obj, callback_event::post_load); | |||
} | } | |||
template <typename T> | template <typename T> | |||
void no_id_object_result_impl<T>:: | void no_id_object_result_impl<T>:: | |||
next () | next () | |||
{ | { | |||
this->current (pointer_type ()); | this->current (pointer_type ()); | |||
if (this->end_) | ||||
return; | ||||
// If we are cached, simply increment the position and | // If we are cached, simply increment the position and | |||
// postpone the actual row fetching until later. This way | // postpone the actual row fetching until later. This way | |||
// if the same object is loaded in between iteration, the | // if the same object is loaded in between iteration, the | |||
// image won't be messed up. | // image won't be messed up. | |||
// | // | |||
count_++; | count_++; | |||
if (statement_->cached ()) | if (statement_->cached ()) | |||
this->end_ = count_ > statement_->result_size (); | this->end_ = count_ > statement_->result_size (); | |||
else | else | |||
skipping to change at line 136 | skipping to change at line 139 | |||
break; | break; | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
void no_id_object_result_impl<T>:: | void no_id_object_result_impl<T>:: | |||
cache () | cache () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_ && !statement_->cached ()) | |||
{ | { | |||
statement_->cache (); | statement_->cache (); | |||
if (count_ >= statement_->result_size ()) | if (count_ == statement_->result_size ()) | |||
{ | { | |||
statement_->free_result (); | statement_->free_result (); | |||
count_++; // One past the result size. | ||||
this->end_ = true; | this->end_ = true; | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
std::size_t no_id_object_result_impl<T>:: | std::size_t no_id_object_result_impl<T>:: | |||
size () | size () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_) | |||
throw result_not_cached (); | { | |||
if (!statement_->cached ()) | ||||
throw result_not_cached (); | ||||
return statement_->result_size (); | return statement_->result_size (); | |||
} | ||||
else | ||||
return count_ - 1; // One past the result size. | ||||
} | } | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 14 lines changed or added | |||
polymorphic-object-result.txx | polymorphic-object-result.txx | |||
---|---|---|---|---|
skipping to change at line 197 | skipping to change at line 197 | |||
return root_traits::discriminator ( | return root_traits::discriminator ( | |||
statements_.root_statements ().image ()); | statements_.root_statements ().image ()); | |||
} | } | |||
template <typename T> | template <typename T> | |||
void polymorphic_object_result_impl<T>:: | void polymorphic_object_result_impl<T>:: | |||
next () | next () | |||
{ | { | |||
this->current (pointer_type ()); | this->current (pointer_type ()); | |||
if (this->end_) | ||||
return; | ||||
// If we are cached, simply increment the position and | // If we are cached, simply increment the position and | |||
// postpone the actual row fetching until later. This way | // postpone the actual row fetching until later. This way | |||
// if the same object is loaded in between iteration, the | // if the same object is loaded in between iteration, the | |||
// image won't be messed up. | // image won't be messed up. | |||
// | // | |||
count_++; | count_++; | |||
if (statement_->cached ()) | if (statement_->cached ()) | |||
this->end_ = count_ > statement_->result_size (); | this->end_ = count_ > statement_->result_size (); | |||
else | else | |||
skipping to change at line 321 | skipping to change at line 324 | |||
// | // | |||
if (!next) | if (!next) | |||
break; | break; | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
void polymorphic_object_result_impl<T>:: | void polymorphic_object_result_impl<T>:: | |||
cache () | cache () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_ && !statement_->cached ()) | |||
{ | { | |||
statement_->cache (); | statement_->cache (); | |||
if (count_ >= statement_->result_size ()) | if (count_ == statement_->result_size ()) | |||
{ | { | |||
statement_->free_result (); | statement_->free_result (); | |||
count_++; // One past the result size. | ||||
this->end_ = true; | this->end_ = true; | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
std::size_t polymorphic_object_result_impl<T>:: | std::size_t polymorphic_object_result_impl<T>:: | |||
size () | size () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_) | |||
throw result_not_cached (); | { | |||
if (!statement_->cached ()) | ||||
throw result_not_cached (); | ||||
return statement_->result_size (); | return statement_->result_size (); | |||
} | ||||
else | ||||
return count_ - 1; // One past the result size. | ||||
} | } | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 14 lines changed or added | |||
simple-object-result.txx | simple-object-result.txx | |||
---|---|---|---|---|
skipping to change at line 105 | skipping to change at line 105 | |||
return object_traits::id (statements_.image ()); | return object_traits::id (statements_.image ()); | |||
} | } | |||
template <typename T> | template <typename T> | |||
void object_result_impl<T>:: | void object_result_impl<T>:: | |||
next () | next () | |||
{ | { | |||
this->current (pointer_type ()); | this->current (pointer_type ()); | |||
if (this->end_) | ||||
return; | ||||
// If we are cached, simply increment the position and | // If we are cached, simply increment the position and | |||
// postpone the actual row fetching until later. This way | // postpone the actual row fetching until later. This way | |||
// if the same object is loaded in between iteration, the | // if the same object is loaded in between iteration, the | |||
// image won't be messed up. | // image won't be messed up. | |||
// | // | |||
count_++; | count_++; | |||
if (statement_->cached ()) | if (statement_->cached ()) | |||
this->end_ = count_ > statement_->result_size (); | this->end_ = count_ > statement_->result_size (); | |||
else | else | |||
skipping to change at line 192 | skipping to change at line 195 | |||
// | // | |||
if (!next) | if (!next) | |||
break; | break; | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
void object_result_impl<T>:: | void object_result_impl<T>:: | |||
cache () | cache () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_ && !statement_->cached ()) | |||
{ | { | |||
statement_->cache (); | statement_->cache (); | |||
if (count_ >= statement_->result_size ()) | if (count_ == statement_->result_size ()) | |||
{ | { | |||
statement_->free_result (); | statement_->free_result (); | |||
count_++; // One past the result size. | ||||
this->end_ = true; | this->end_ = true; | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
std::size_t object_result_impl<T>:: | std::size_t object_result_impl<T>:: | |||
size () | size () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_) | |||
throw result_not_cached (); | { | |||
if (!statement_->cached ()) | ||||
throw result_not_cached (); | ||||
return statement_->result_size (); | return statement_->result_size (); | |||
} | ||||
else | ||||
return count_ - 1; // One past the result size. | ||||
} | } | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 14 lines changed or added | |||
version.hxx | version.hxx | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
// Check that we have a compatible MySQL version (5.0.3 or later). | // Check that we have a compatible MySQL version (5.0.3 or later). | |||
// | // | |||
#if !defined(MYSQL_VERSION_ID) || MYSQL_VERSION_ID < 50003 | #if !defined(MYSQL_VERSION_ID) || MYSQL_VERSION_ID < 50003 | |||
# error incompatible MySQL version detected | # error incompatible MySQL version detected | |||
#endif | #endif | |||
// libodb-mysql version: odb interface version plus the bugfix | // libodb-mysql version: odb interface version plus the bugfix | |||
// version. | // version. | |||
// | // | |||
#define LIBODB_MYSQL_VERSION 2010000 | #define LIBODB_MYSQL_VERSION 2010100 | |||
#define LIBODB_MYSQL_VERSION_STR "2.1.0" | #define LIBODB_MYSQL_VERSION_STR "2.1.1" | |||
#include <odb/post.hxx> | #include <odb/post.hxx> | |||
#endif // ODB_MYSQL_VERSION_HXX | #endif // ODB_MYSQL_VERSION_HXX | |||
End of changes. 1 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
view-result.txx | view-result.txx | |||
---|---|---|---|---|
skipping to change at line 54 | skipping to change at line 54 | |||
view_traits::init (view, statements_.image (), &db); | view_traits::init (view, statements_.image (), &db); | |||
view_traits::callback (db, view, callback_event::post_load); | view_traits::callback (db, view, callback_event::post_load); | |||
} | } | |||
template <typename T> | template <typename T> | |||
void view_result_impl<T>:: | void view_result_impl<T>:: | |||
next () | next () | |||
{ | { | |||
this->current (pointer_type ()); | this->current (pointer_type ()); | |||
if (this->end_) | ||||
return; | ||||
// If we are cached, simply increment the position and | // If we are cached, simply increment the position and | |||
// postpone the actual row fetching until later. This way | // postpone the actual row fetching until later. This way | |||
// if the same view is loaded in between iteration, the | // if the same view is loaded in between iteration, the | |||
// image won't be messed up. | // image won't be messed up. | |||
// | // | |||
count_++; | count_++; | |||
if (statement_->cached ()) | if (statement_->cached ()) | |||
this->end_ = count_ > statement_->result_size (); | this->end_ = count_ > statement_->result_size (); | |||
else | else | |||
skipping to change at line 135 | skipping to change at line 138 | |||
break; | break; | |||
} | } | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
void view_result_impl<T>:: | void view_result_impl<T>:: | |||
cache () | cache () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_ && !statement_->cached ()) | |||
{ | { | |||
statement_->cache (); | statement_->cache (); | |||
if (count_ >= statement_->result_size ()) | if (count_ == statement_->result_size ()) | |||
{ | { | |||
statement_->free_result (); | statement_->free_result (); | |||
count_++; // One past the result size. | ||||
this->end_ = true; | this->end_ = true; | |||
} | } | |||
} | } | |||
} | } | |||
template <typename T> | template <typename T> | |||
std::size_t view_result_impl<T>:: | std::size_t view_result_impl<T>:: | |||
size () | size () | |||
{ | { | |||
if (!statement_->cached ()) | if (!this->end_) | |||
throw result_not_cached (); | { | |||
if (!statement_->cached ()) | ||||
throw result_not_cached (); | ||||
return statement_->result_size (); | return statement_->result_size (); | |||
} | ||||
else | ||||
return count_ - 1; // One past the result size. | ||||
} | } | |||
} | } | |||
} | } | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 14 lines changed or added | |||