From 1d3edf0de34c311014fd222a737e96c9f1d5b83a Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Tue, 5 Jul 2011 14:13:01 +0200 Subject: Only bind native binding structure when references are present --- odb/pgsql/query.cxx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'odb') diff --git a/odb/pgsql/query.cxx b/odb/pgsql/query.cxx index 36a624b..1c5f9d4 100644 --- a/odb/pgsql/query.cxx +++ b/odb/pgsql/query.cxx @@ -257,7 +257,7 @@ namespace odb if (n == 0) return native_binding_; - bool inc_ver (false); + bool ref (false), inc_ver (false); binding& r (binding_); bind* b (&bind_[0]); @@ -267,6 +267,8 @@ namespace odb if (p.reference ()) { + ref = true; + if (p.init ()) { p.bind (b + i); @@ -275,10 +277,14 @@ namespace odb } } - if (inc_ver) - r.version++; + if (ref) + { + statement::bind_param (native_binding_, binding_); + + if (inc_ver) + r.version++; + } - statement::bind_param (native_binding_, binding_); return native_binding_; } -- cgit v1.1