aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/oracle/statement.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx
index f923da6..21e976b 100644
--- a/odb/oracle/statement.cxx
+++ b/odb/oracle/statement.cxx
@@ -411,13 +411,15 @@ namespace odb
if (!done_)
free_result ();
+ OCIError* err (conn_.error_handle ());
+
// @@ Retrieve a single row into the already bound output buffers as an
// optimization? This will avoid multiple server round-trips in the case
// of a single object load.
//
sword r (OCIStmtExecute (conn_.handle (),
stmt_,
- conn_.error_handle (),
+ err,
0,
0,
0,
@@ -425,7 +427,17 @@ namespace odb
OCI_DEFAULT));
if (r == OCI_ERROR || r == OCI_INVALID_HANDLE)
- translate_error (conn_.error_handle (), r);
+ translate_error (err, r);
+
+#ifndef NDEBUG
+ ub4 n (0);
+ r = OCIAttrGet(stmt_, OCI_HTYPE_STMT, &n, 0, OCI_ATTR_PARAM_COUNT, err);
+
+ if (r == OCI_ERROR || r == OCI_INVALID_HANDLE)
+ translate_error (err, r);
+
+ assert (n == data_.count);
+#endif
}
select_statement::result select_statement::