Added a check to report an error when the DB is not reporting an error in DML RETURNING statements.

This commit is contained in:
Christopher Jones 2015-09-25 18:30:36 +10:00
parent 9dff2f4a1d
commit aa7a43794e
4 changed files with 19 additions and 0 deletions

View File

@ -2,6 +2,9 @@
## node-oracledb v1.2.0 (DD Mon YYYY)
- Added a check to return an NJS error when an invalid DML RETURN statement
does not give an ORA error.
- Added support for RAW data type.
- Fixed intermittent crash while setting `fetchAsString`, and incorrect output while reading the value.

View File

@ -931,6 +931,20 @@ void Connection::Async_Execute (uv_work_t *req)
executeBaton->dpistmt->execute(1, executeBaton->autoCommit);
executeBaton->rowsAffected = executeBaton->dpistmt->rowsAffected();
// Check whether indicators were allocated as part of callback
if ( executeBaton->stmtIsReturning )
{
for ( unsigned int b = 0; b < executeBaton->binds.size (); b++ )
{
if ( executeBaton->binds[b]->isOut && !executeBaton->binds[b]->ind)
{
executeBaton->error = NJSMessages::getErrorMsg (
errSQLSyntaxError );
return;
}
}
}
/* Check to see if the string buffer size is good in case of
* DML Returning.
*/

View File

@ -60,6 +60,7 @@ static const char *errMsg[] =
"NJS-024: memory allocation failed",
"NJS-025: overflow when calculating results area size",
"NJS-026: maxRows must be greater than zero",
"NJS-027: unexpected SQL parsing error",
"NJS-027: raw database type is not supported with DML Returning statements",
};

View File

@ -59,6 +59,7 @@ typedef enum
errInsufficientMemory,
errResultsTooLarge,
errInvalidmaxRows,
errSQLSyntaxError,
errBufferReturningInvalid,
// New ones should be added here