diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-06 14:57:40 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-09-06 14:57:40 +0200 |
commit | 7d3f2b0badf4298bca53936d22a0a22c74538713 (patch) | |
tree | 9eac746a0634c1b854507d55fc792fa61a7009ce /odb/sqlite/statement.cxx | |
parent | 4ee004a6de190316d5ff2fb8bfe0f28b33d74e7f (diff) |
Allow select statement without parameters
Diffstat (limited to 'odb/sqlite/statement.cxx')
-rw-r--r-- | odb/sqlite/statement.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx index d0020d5..6417b3a 100644 --- a/odb/sqlite/statement.cxx +++ b/odb/sqlite/statement.cxx @@ -239,7 +239,15 @@ namespace odb const string& s, binding& cond, binding& data) - : statement (conn, s), cond_ (cond), data_ (data) + : statement (conn, s), cond_ (&cond), data_ (data) + { + } + + select_statement:: + select_statement (connection& conn, + const string& s, + binding& data) + : statement (conn, s), cond_ (0), data_ (data) { } @@ -250,7 +258,10 @@ namespace odb reset (); done_ = false; - bind_param (cond_.bind, cond_.count); + + if (cond_ != 0) + bind_param (cond_->bind, cond_->count); + active (true); } |