aboutsummaryrefslogtreecommitdiff
path: root/odb/pgsql/statement.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-22 11:43:52 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-22 11:43:52 +0200
commitb536a5596073c6e253a8270d7da3280b23165e4f (patch)
tree8f3e540854be74a32e7e196e8afce97b0ec19cce /odb/pgsql/statement.cxx
parentee570de4bd013fd2a4351d33d11539621f00bf57 (diff)
Add support for constructing delete_statement with native binding only
This is similar to what we do in select_statement.
Diffstat (limited to 'odb/pgsql/statement.cxx')
-rw-r--r--odb/pgsql/statement.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/odb/pgsql/statement.cxx b/odb/pgsql/statement.cxx
index f9a4fb7..26ae475 100644
--- a/odb/pgsql/statement.cxx
+++ b/odb/pgsql/statement.cxx
@@ -572,7 +572,20 @@ namespace odb
binding& cond,
native_binding& native_cond)
: statement (conn, name, stmt, types, types_count),
- cond_ (cond),
+ cond_ (&cond),
+ native_cond_ (native_cond)
+ {
+ }
+
+ delete_statement::
+ delete_statement (connection& conn,
+ const string& name,
+ const string& stmt,
+ const Oid* types,
+ size_t types_count,
+ native_binding& native_cond)
+ : statement (conn, name, stmt, types, types_count),
+ cond_ (0),
native_cond_ (native_cond)
{
}
@@ -580,7 +593,8 @@ namespace odb
unsigned long long delete_statement::
execute ()
{
- bind_param (native_cond_, cond_);
+ if (cond_ != 0)
+ bind_param (native_cond_, *cond_);
result_ptr r (PQexecPrepared (conn_.handle (),
name_.c_str (),