diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:01:24 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-10-14 14:24:33 +0200 |
commit | 8030f64e42ec04eb8dd2803ea23e03ea0942f37f (patch) | |
tree | 6a59ed4da09a850edce55aa96b2b395ca6e2d0f0 | |
parent | 2b289fe713cd0ece2ce0b5cf6309707ce8a23e1f (diff) |
Small bug fixes and aesthetic changes
-rw-r--r-- | odb/oracle/details/number.cxx | 2 | ||||
-rw-r--r-- | odb/oracle/statement.cxx | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/odb/oracle/details/number.cxx b/odb/oracle/details/number.cxx index d328b1f..e62894d 100644 --- a/odb/oracle/details/number.cxx +++ b/odb/oracle/details/number.cxx @@ -200,7 +200,7 @@ namespace odb // Test the sign bit of the exponent. // - if (ub[1] & 0x80) + if ((ub[1] & 0x80) == 0) { assert (false); return 0; diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx index 26d2836..df3c42b 100644 --- a/odb/oracle/statement.cxx +++ b/odb/oracle/statement.cxx @@ -116,7 +116,7 @@ namespace odb else *piece = OCI_ONE_PIECE; - *indicator = &b.indicator; + *indicator = b.indicator; return OCI_CONTINUE; } @@ -158,7 +158,7 @@ namespace odb // ++o; - for (size_t e (o + c); o < e; ++c, ++b) + for (size_t e (o + c); o < e; ++o, ++b) { #if OCI_MAJOR_VERSION < 11 || \ (OCI_MAJOR_VERSION == 11 && OCI_MINOR_VERSION < 2) @@ -166,7 +166,8 @@ namespace odb // version is unable to implicitly convert the NUMBER binary data // to the relevant type. // - assert (b->type != bind::integer || b->capacity <= 4); + assert ((b->type != bind::integer && b->type != bind::uinteger) || + b->capacity <= 4); #endif bool callback (b->callback != 0); @@ -234,7 +235,7 @@ namespace odb // descriptor has not yet been allocated, it is allocated now. // auto_descriptor<OCILobLocator>* lob ( - reinterpret_cast<auto_descriptor<OCILobLocator>*> (b->size)); + reinterpret_cast<auto_descriptor<OCILobLocator>*> (b->size)); if (lob->get () == 0) { @@ -250,7 +251,7 @@ namespace odb // OCI_INVALID_HANDLE on an out-of-memory condition. // if (r != OCI_SUCCESS) - throw bad_alloc (); + throw invalid_oci_handle (); lob->reset (h); } @@ -299,7 +300,7 @@ namespace odb // version is unable to implicitly convert the NUMBER binary data // to the relevant type. // - assert ((b->type != bind::integer || b->type != bind::uinteger) && + assert ((b->type != bind::integer && b->type != bind::uinteger) || b->capacity <= 4); #endif @@ -323,7 +324,7 @@ namespace odb ub1 form (SQLCS_NCHAR); r = OCIAttrSet (h, - OCI_HTYPE_BIND, + OCI_HTYPE_DEFINE, &form, 0, OCI_ATTR_CHARSET_FORM, @@ -356,7 +357,8 @@ namespace odb // assert (b->capacity != 0); - OCILobLocator* locator (reinterpret_cast<OCILobLocator*> (b->size)); + auto_descriptor<OCILobLocator>& locator ( + *reinterpret_cast<auto_descriptor<OCILobLocator>* > (b->size)); ub1 piece (OCI_FIRST_PIECE); |