From 8030f64e42ec04eb8dd2803ea23e03ea0942f37f Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 14 Oct 2011 14:01:24 +0200 Subject: Small bug fixes and aesthetic changes --- odb/oracle/details/number.cxx | 2 +- 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* lob ( - reinterpret_cast*> (b->size)); + reinterpret_cast*> (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 (b->size)); + auto_descriptor& locator ( + *reinterpret_cast* > (b->size)); ub1 piece (OCI_FIRST_PIECE); -- cgit v1.1