diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-11-15 11:33:52 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-16 12:48:18 +0200 |
commit | 7f348b4e2874d7aa39fbf093e56323f6e73ca052 (patch) | |
tree | d569a52449818242099aef9b15090028250f83f4 /odb/oracle/statement.cxx | |
parent | d45a104481288b37b6060a4d5140d0296a82b4e6 (diff) |
Interpret NULL bind::indicator pointer as a non-NULL value indicator
Diffstat (limited to 'odb/oracle/statement.cxx')
-rw-r--r-- | odb/oracle/statement.cxx | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/odb/oracle/statement.cxx b/odb/oracle/statement.cxx index e9f7a45..c6fa745 100644 --- a/odb/oracle/statement.cxx +++ b/odb/oracle/statement.cxx @@ -358,18 +358,19 @@ namespace odb // Initialize the descriptor from the cached data. // - r = OCIDateTimeConstruct (env, - err, - static_cast<OCIDateTime*> (d), - dt->year_, - dt->month_, - dt->day_, - dt->hour_, - dt->minute_, - dt->second_, - dt->nanosecond_, - 0, - 0); + if (b->indicator == 0 || *b->indicator != -1) + r = OCIDateTimeConstruct (env, + err, + static_cast<OCIDateTime*> (d), + dt->year_, + dt->month_, + dt->day_, + dt->hour_, + dt->minute_, + dt->second_, + dt->nanosecond_, + 0, + 0); if (r != OCI_SUCCESS) translate_error (err, r); @@ -419,11 +420,12 @@ namespace odb // Initialize the descriptor from the cached data. // - r = OCIIntervalSetYearMonth (env, - err, - iym->year_, - iym->month_, - static_cast<OCIInterval*> (d)); + if (b->indicator == 0 || *b->indicator != -1) + r = OCIIntervalSetYearMonth (env, + err, + iym->year_, + iym->month_, + static_cast<OCIInterval*> (d)); if (r != OCI_SUCCESS) translate_error (err, r); @@ -473,14 +475,15 @@ namespace odb // Initialize the descriptor from the cached data. // - r = OCIIntervalSetDaySecond (env, - err, - ids->day_, - ids->hour_, - ids->minute_, - ids->second_, - ids->nanosecond_, - static_cast<OCIInterval*> (d)); + if (b->indicator == 0 || *b->indicator != -1) + r = OCIIntervalSetDaySecond (env, + err, + ids->day_, + ids->hour_, + ids->minute_, + ids->second_, + ids->nanosecond_, + static_cast<OCIInterval*> (d)); if (r != OCI_SUCCESS) translate_error (err, r); @@ -955,7 +958,8 @@ namespace odb if ((b->type == bind::blob || b->type == bind::clob || b->type == bind::nclob) && - *b->indicator != -1 && b->callback->result != 0) + (b->indicator == 0 || *b->indicator != -1) && + b->callback->result != 0) { auto_descriptor<OCILobLocator>& locator ( *reinterpret_cast<auto_descriptor<OCILobLocator>*> (b->buffer)); |