@@ -935,12 +935,13 @@ void Connection::Async_Execute (uv_work_t *req)
935
935
}
936
936
}
937
937
938
- /* For each OUT Binds of CURSOR type, get the number of columns */
938
+ /* For each OUT Binds of CURSOR type, get the dpistmt state */
939
939
for ( unsigned int b = 0 ; b < executeBaton->binds .size (); b ++ )
940
940
{
941
941
Bind *bind = executeBaton->binds [b];
942
942
943
- if ( bind->isOut && bind->type == dpi::DpiRSet )
943
+ /* Here bind->isOut is expected to be TRUE, and is checked earlier */
944
+ if ( bind->type == dpi::DpiRSet )
944
945
{
945
946
unsigned long state = ((Stmt*)bind->value )->getState ();
946
947
@@ -1424,14 +1425,14 @@ void Connection::DoDefines ( eBaton* executeBaton, const dpi::MetaData* meta,
1424
1425
defines[col].fetchType = Connection::GetTargetType ( executeBaton,
1425
1426
executeBaton->columnNames [col],
1426
1427
meta[col].dbType );
1428
+
1427
1429
/*
1428
1430
* the buffer size is increased to account for possible character
1429
1431
* size expansion when data is converted from the DB character set
1430
1432
* to AL32UTF8
1431
1433
*/
1432
1434
1433
- defines[col].maxSize = (meta[col].dbSize ) * csratio;
1434
-
1435
+ defines[col].maxSize = (meta[col].dbSize ) * csratio;
1435
1436
1436
1437
if ( NJS_SIZE_T_OVERFLOW ( defines[col].maxSize ,
1437
1438
executeBaton->maxRows ) )
@@ -2064,6 +2065,10 @@ Handle<Value> Connection::GetValueRefCursor ( eBaton *executeBaton,
2064
2065
{
2065
2066
resultSet = NanNew (ResultSet::resultSetTemplate_s)->
2066
2067
GetFunction () ->NewInstance ();
2068
+ /*
2069
+ * IN case of REFCURSOR, bind->flags will indicate whether we got
2070
+ * a valid handle, based on that numCols, metaData are queried.
2071
+ */
2067
2072
(ObjectWrap::Unwrap<ResultSet> (resultSet))->
2068
2073
setResultSet ( (dpi::Stmt*)(bind->value ),
2069
2074
executeBaton);
@@ -2827,7 +2832,7 @@ void Connection::cbDynBufferAllocate ( void *ctx, bool dmlReturning,
2827
2832
}
2828
2833
else
2829
2834
{
2830
- bind->ind = (short *)malloc ( nRows * sizeof ( short ) ) ;
2835
+ bind->ind = (short *)malloc ( ( size_t ) nRows * sizeof ( short ) ) ;
2831
2836
if ( !bind->ind )
2832
2837
{
2833
2838
executeBaton->error = NJSMessages::getErrorMsg ( errInsufficientMemory );
0 commit comments