From 5f66b4f0b1370c167e9aed2334e112d07f93f3b0 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 14 Oct 2011 13:39:04 +0200 Subject: Adhere to OCI recommendations for unused arguments when binding callbacks --- odb/oracle/statement.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx index 3de8619..0e7d387 100644 --- a/odb/oracle/statement.cxx +++ b/odb/oracle/statement.cxx @@ -169,21 +169,22 @@ namespace odb assert (b->type != bind::integer || b->capacity <= 4); #endif + bool callback (b->callback != 0); OCIBind* h (0); + sword r (OCIBindByPos (stmt_, &h, err, o, - b->buffer, + callback ? 0 : b->buffer, static_cast (b->capacity), param_sqlt_lookup[b->type], - b->indicator, - b->size, + callback ? 0 : b->indicator, + callback ? 0 : b->size, 0, 0, 0, - b->callback.param != 0 ? - OCI_DATA_AT_EXEC : OCI_DEFAULT)); + callback ? OCI_DATA_AT_EXEC : OCI_DEFAULT)); if (r == OCI_ERROR || r == OCI_INVALID_HANDLE) translate_error (err, r); @@ -203,7 +204,7 @@ namespace odb translate_error (err, r); } - if (b->callback.param != 0) + if (callback) { r = OCIBindDynamic (h, err, b, ¶m_callback_proxy, 0, 0); -- cgit v1.1