@@ -88,6 +88,13 @@ describe('55. resultSet2.js', function() {
88
88
WHERE employees_id > p_in; \
89
89
END; " ;
90
90
91
+ var proc2 =
92
+ "CREATE OR REPLACE PROCEDURE get_invalid_refcur ( p OUT SYS_REFCURSOR) \
93
+ AS \
94
+ BEGIN \
95
+ NULL; \
96
+ END; " ;
97
+
91
98
beforeEach ( function ( done ) {
92
99
async . series ( [
93
100
function ( callback ) {
@@ -130,6 +137,17 @@ describe('55. resultSet2.js', function() {
130
137
callback ( ) ;
131
138
}
132
139
) ;
140
+ } ,
141
+ function ( callback ) {
142
+ connection . execute (
143
+ proc2 ,
144
+ [ ] ,
145
+ { autoCommit : true } ,
146
+ function ( err ) {
147
+ should . not . exist ( err ) ;
148
+ callback ( ) ;
149
+ }
150
+ ) ;
133
151
}
134
152
] , done ) ;
135
153
} )
@@ -154,6 +172,16 @@ describe('55. resultSet2.js', function() {
154
172
}
155
173
) ;
156
174
} ,
175
+ function ( callback ) {
176
+ connection . execute (
177
+ 'DROP PROCEDURE get_invalid_refcur' ,
178
+ function ( err ) {
179
+ should . not . exist ( err ) ;
180
+ callback ( ) ;
181
+ }
182
+ ) ;
183
+ } ,
184
+
157
185
function ( callback ) {
158
186
connection . release ( function ( err ) {
159
187
should . not . exist ( err ) ;
@@ -340,11 +368,39 @@ describe('55. resultSet2.js', function() {
340
368
}
341
369
}
342
370
} )
371
+
372
+ it ( '55.3.3 Invalid REF Cursor' , function ( done ) {
373
+ connection . should . be . ok ;
374
+
375
+ connection . execute (
376
+ "BEGIN get_invalid_refcur ( :p ); END; " ,
377
+ {
378
+ p : { type : oracledb . CURSOR , dir : oracledb . BIND_OUT }
379
+ } ,
380
+ function ( err , result ) {
381
+ should . not . exist ( err ) ;
382
+ fetchRowFromRS2 ( result . outBinds . out , done ) ;
383
+ } ) ;
384
+
385
+
386
+ function fetchRowFromRS2 ( rs , cb ) {
387
+ if ( rs ) {
388
+ rs . getRow ( function ( err , row ) {
389
+ should . not . exist ( err ) ;
390
+ if ( row ) {
391
+ return fetchRowFromRS ( rs , cb ) ;
392
+ }
393
+ } ) ;
394
+ }
395
+ cb ( ) ;
396
+ }
397
+ } ) ;
343
398
} )
344
399
345
400
describe ( '55.4 release connection before close resultSet' , function ( ) {
346
401
var conn2 = false ;
347
402
function fetchRowFromRS ( rs , cb ) {
403
+
348
404
rs . getRow ( function ( err , row ) {
349
405
if ( row ) {
350
406
return fetchRowFromRS ( rs , cb ) ;
0 commit comments