diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-10-12 17:24:44 +0200 |
commit | 9126281b53722115b2e8624632f2dd616f0c26a0 (patch) | |
tree | 2c901cd17dc2b09c7f344d1dd21ce1c83f9dab2b /odb/mysql/query.cxx | |
parent | c0af27a770b1505ad6a1226f57f90642ce395296 (diff) |
Completion of prepared query support
Diffstat (limited to 'odb/mysql/query.cxx')
-rw-r--r-- | odb/mysql/query.cxx | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/odb/mysql/query.cxx b/odb/mysql/query.cxx index bc0c4f0..6ca825c 100644 --- a/odb/mysql/query.cxx +++ b/odb/mysql/query.cxx @@ -136,19 +136,12 @@ namespace odb p->bind (b); } - binding& query_base:: - parameters_binding () const + void query_base:: + init_parameters () const { - size_t n (parameters_.size ()); - binding& r (binding_); - - if (n == 0) - return r; - bool inc_ver (false); - MYSQL_BIND* b (&bind_[0]); - for (size_t i (0); i < n; ++i) + for (size_t i (0); i < parameters_.size (); ++i) { query_param& p (*parameters_[i]); @@ -156,16 +149,14 @@ namespace odb { if (p.init ()) { - p.bind (b + i); + p.bind (&bind_[i]); inc_ver = true; } } } if (inc_ver) - r.version++; - - return r; + binding_.version++; } static bool |