aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/object-statements.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-10-30 17:52:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-10-30 17:52:31 +0200
commit8f49a9a3eddfbaa3afda78aad964268b31d0890b (patch)
tree218f7f0205f1628dd04a452d7d30265c8da11b56 /odb/mysql/object-statements.hxx
parentf534ea71ba1b2109aee50fcd2dfe7f6ee0a6a707 (diff)
Rework statement interfaces wrt param/result passing
Diffstat (limited to 'odb/mysql/object-statements.hxx')
-rw-r--r--odb/mysql/object-statements.hxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/odb/mysql/object-statements.hxx b/odb/mysql/object-statements.hxx
index 9ea9933..0c20b1b 100644
--- a/odb/mysql/object-statements.hxx
+++ b/odb/mysql/object-statements.hxx
@@ -219,6 +219,12 @@ namespace odb
void
update_image_version (std::size_t v) {update_image_version_ = v;}
+ std::size_t
+ update_id_image_version () const { return update_id_image_version_;}
+
+ void
+ update_id_image_version (std::size_t v) {update_id_image_version_ = v;}
+
binding&
update_image_binding () {return update_image_binding_;}
@@ -287,7 +293,6 @@ namespace odb
new (details::shared) update_statement_type (
conn_,
object_traits::update_statement,
- id_image_binding_,
update_image_binding_));
return *update_;
@@ -360,10 +365,13 @@ namespace odb
binding insert_image_binding_;
MYSQL_BIND insert_image_bind_[insert_column_count];
- // Update binding. The suffix of the bind array is object id. The
- // update statement depends on this being one contiguous arrays.
+ // Update binding. Note that the id suffix is bound to id_image_
+ // below instead of image_ which makes this binding effectively
+ // bound to two images. As a result, we have to track versions
+ // for both of them.
//
std::size_t update_image_version_;
+ std::size_t update_id_image_version_;
binding update_image_binding_;
MYSQL_BIND update_image_bind_[update_column_count + id_column_count];