aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/pgsql/statement.cxx18
-rw-r--r--odb/pgsql/statement.hxx9
2 files changed, 24 insertions, 3 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 (),
diff --git a/odb/pgsql/statement.hxx b/odb/pgsql/statement.hxx
index 3a25f5e..11e04b3 100644
--- a/odb/pgsql/statement.hxx
+++ b/odb/pgsql/statement.hxx
@@ -246,6 +246,13 @@ namespace odb
binding& cond,
native_binding& native_cond);
+ delete_statement (connection& conn,
+ const std::string& name,
+ const std::string& stmt,
+ const Oid* types,
+ std::size_t types_count,
+ native_binding& native_cond);
+
unsigned long long
execute ();
@@ -254,7 +261,7 @@ namespace odb
delete_statement& operator= (const delete_statement&);
private:
- binding& cond_;
+ binding* cond_;
native_binding& native_cond_;
};
}