aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/statement.cxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-09-29 09:01:46 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-09-29 09:01:46 +0200
commit63884d028d25114263f53fbc8c2025003b8900c9 (patch)
treeeb72b2c912206549b47eec4d0bb57a36ae75b7a8 /odb/oracle/statement.cxx
parentec1683514402dfed20b8a08824e2aa1bb017d6e7 (diff)
Add assertion for mismatch of result set column count
This is useful for detecting native views that happen to have stray data members.
Diffstat (limited to 'odb/oracle/statement.cxx')
-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::