File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
lib/thin/protocol/messages Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,9 @@ class MessageWithData extends Message {
447
447
448
448
if ( ! this . inFetch ) {
449
449
const actualNumBytes = buf . readSB4 ( ) ;
450
- if ( actualNumBytes !== 0 && colValue !== null ) {
450
+ if ( actualNumBytes < 0 && oraTypeNum === constants . TNS_DATA_TYPE_BOOLEAN ) {
451
+ colValue = null ;
452
+ } else if ( actualNumBytes !== 0 && colValue !== null ) {
451
453
errors . throwErr ( errors . ERR_INSUFFICIENT_BUFFER_FOR_BINDS ) ;
452
454
}
453
455
} else if ( oraTypeNum === constants . TNS_DATA_TYPE_LONG || oraTypeNum === constants . TNS_DATA_TYPE_LONG_RAW || variable . maxSize > buf . caps . maxStringSize ) {
Original file line number Diff line number Diff line change @@ -273,4 +273,14 @@ describe('224. booleanBind.js', function() {
273
273
//(result.outBinds[0].DATEVALUE).should.be.a.Date();
274
274
assert . strictEqual ( true , result . outBinds [ 0 ] . BOOLEANVALUE ) ;
275
275
} ) ; // 224.9
276
+
277
+ it ( '224.10 OUT bind value "null"' , async function ( ) {
278
+ const binds = {
279
+ outval : { dir : oracledb . BIND_OUT , type : oracledb . DB_TYPE_BOOLEAN }
280
+ } ;
281
+ const sql = `begin :outval := null; end;` ;
282
+
283
+ const result = await conn . execute ( sql , binds ) ;
284
+ assert . strictEqual ( null , result . outBinds . outval ) ;
285
+ } ) ; // 224.10
276
286
} ) ;
You can’t perform that action at this time.
0 commit comments