@@ -64,6 +64,12 @@ Persistent<FunctionTemplate> ResultSet::resultSetTemplate_s;
6464/*
6565 DESCRIPTION
6666 Store the config in pool instance.
67+
68+ PARAMETERS
69+ stmt - dpi statement
70+ env - dpi Env
71+ conn - njs connection
72+ outFormat - outFormat of the result set
6773*/
6874void ResultSet::setResultSet ( dpi::Stmt *stmt, dpi::Env *env,
6975 Connection *conn, unsigned int outFormat )
@@ -179,7 +185,7 @@ NAN_SETTER(ResultSet::SetMetaData)
179185 Get Row method on Result Set class.
180186
181187 PARAMETERS:
182- Arguments - callback
188+ args - callback
183189*/
184190NAN_METHOD (ResultSet::GetRow)
185191{
@@ -208,7 +214,7 @@ NAN_METHOD(ResultSet::GetRow)
208214 Get Rows method on Result Set class.
209215
210216 PARAMETERS:
211- Arguments - numRows, callback
217+ args - numRows, callback
212218*/
213219NAN_METHOD (ResultSet::GetRows)
214220{
@@ -224,6 +230,12 @@ NAN_METHOD(ResultSet::GetRows)
224230 NJS_CHECK_NUMBER_OF_ARGS ( getRowsBaton->error , args, 2 , 2 , exitGetRows );
225231 NJS_GET_ARG_V8UINT ( getRowsBaton->numRows , getRowsBaton->error ,
226232 args, 0 , exitGetRows );
233+ if (!getRowsBaton->numRows )
234+ {
235+ getRowsBaton->error = NJSMessages::getErrorMsg (
236+ errInvalidParameterValue, 1 );
237+ goto exitGetRows;
238+ }
227239
228240 getRowsBaton->fetchMultiple = true ;
229241 getRowsBaton->njsRS = njsResultSet;
@@ -238,7 +250,7 @@ NAN_METHOD(ResultSet::GetRows)
238250 Common method for GetRow and GetRows method
239251
240252 PARAMETERS:
241- Arguments - resultset baton
253+ getRowsBaton - resultset baton
242254*/
243255void ResultSet::GetRowsCommon (rsBaton *getRowsBaton)
244256{
@@ -263,8 +275,7 @@ void ResultSet::GetRowsCommon(rsBaton *getRowsBaton)
263275 goto exitGetRowsCommon;
264276 }
265277
266- getRowsBaton->ebaton = new eBaton;
267- ebaton = getRowsBaton->ebaton ;
278+ getRowsBaton->ebaton = ebaton = new eBaton;
268279 njsRS = getRowsBaton->njsRS ;
269280
270281 njsRS->state_ = ACTIVE;
@@ -289,7 +300,7 @@ void ResultSet::GetRowsCommon(rsBaton *getRowsBaton)
289300 Worker function of GetRows method
290301
291302 PARAMETERS:
292- UV queue work block
303+ req - UV queue work block
293304
294305 NOTES:
295306 DPI call execution.
@@ -345,7 +356,7 @@ void ResultSet::Async_GetRows(uv_work_t *req)
345356 Callback function of GetRows method
346357
347358 PARAMETERS:
348- UV queue work block
359+ req - UV queue work block
349360*/
350361void ResultSet::Async_AfterGetRows (uv_work_t *req)
351362{
@@ -401,7 +412,7 @@ void ResultSet::Async_AfterGetRows(uv_work_t *req)
401412 Close method
402413
403414 PARAMETERS:
404- Arguments - Callback
415+ args - Callback
405416*/
406417NAN_METHOD (ResultSet::Close)
407418{
@@ -450,7 +461,7 @@ NAN_METHOD(ResultSet::Close)
450461 Worker function of close.
451462
452463 PARAMETERS:
453- UV queue work block
464+ req - UV queue work block
454465
455466 NOTES:
456467 DPI call execution.
@@ -486,7 +497,7 @@ void ResultSet::Async_Close(uv_work_t *req)
486497 Callback function of close
487498
488499 PARAMETERS:
489- UV queue work block
500+ req - UV queue work block
490501*/
491502void ResultSet::Async_AfterClose (uv_work_t *req)
492503{
@@ -522,7 +533,8 @@ void ResultSet::Async_AfterClose(uv_work_t *req)
522533 Free FetchBuffers
523534
524535 PARAMETERS:
525- Fetch Buffer, numCols
536+ defineBuffers - Define bufferes from njsResultSet,
537+ numCols - # of columns
526538*/
527539void ResultSet::clearFetchBuffer ( Define* defineBuffers, unsigned int numCols)
528540{
0 commit comments