@@ -597,68 +597,57 @@ describe('80.blobDMLBindAsBuffer.js', function() {
597
597
var content = node6plus ? Buffer . from ( bigStr , "utf-8" ) : new Buffer ( bigStr , "utf-8" ) ;
598
598
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, :c) RETURNING blob INTO :lobbv" ;
599
599
600
- async . series ( [
601
- function ( cb ) {
602
- connection . execute (
603
- sql ,
604
- {
605
- i : id ,
606
- c : { val : content , type : oracledb . BUFFER , dir : oracledb . BIND_IN } ,
607
- lobbv : { type : oracledb . BUFFER , dir : oracledb . BIND_OUT , maxSize : contentLength }
608
- } ,
609
- function ( err ) {
610
- should . exist ( err ) ;
611
- // NJS-028: RAW database type is not supported with DML Returning statements
612
- ( err . message ) . should . startWith ( 'NJS-028:' ) ;
613
- cb ( ) ;
614
- }
615
- ) ;
600
+ connection . execute (
601
+ sql ,
602
+ {
603
+ i : id ,
604
+ c : { val : content , type : oracledb . BUFFER , dir : oracledb . BIND_IN } ,
605
+ lobbv : { type : oracledb . BUFFER , dir : oracledb . BIND_OUT , maxSize : contentLength }
606
+ } ,
607
+ function ( err ) {
608
+ should . exist ( err ) ;
609
+ // NJS-028: RAW database type is not supported with DML Returning statements
610
+ ( err . message ) . should . startWith ( 'NJS-028:' ) ;
611
+ done ( ) ;
616
612
}
617
- ] , done ) ;
613
+ ) ;
618
614
} ) ; // 80.1.20
619
615
620
616
it ( '80.1.21 Negative: RETURNING INTO with autocommit on' , function ( done ) {
621
617
var id = getID ( ) ;
622
618
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, EMPTY_BLOB()) RETURNING blob INTO :lobbv" ;
623
619
var inFileName = './test/tree.jpg' ;
624
620
625
- async . series ( [
626
- function ( cb ) {
627
- connection . execute (
628
- sql ,
629
- {
630
- i : id ,
631
- lobbv : { type : oracledb . BLOB , dir : oracledb . BIND_OUT }
632
- } ,
633
- { autoCommit : true } ,
634
- function ( err , result ) {
635
- should . not . exist ( err ) ;
636
- var inStream = fs . createReadStream ( inFileName ) ;
637
- var lob = result . outBinds . lobbv [ 0 ] ;
638
-
639
- lob . on ( 'error' , function ( err ) {
640
- should . exist ( err ) ;
641
- // ORA-22990: LOB locators cannot span transactions
642
- ( err . message ) . should . startWith ( 'ORA-22990:' ) ;
643
- } ) ;
644
-
645
- inStream . on ( 'error' , function ( err ) {
646
- should . not . exist ( err , "inStream.on 'error' event" ) ;
647
- } ) ;
648
-
649
- lob . on ( 'close' , function ( err ) {
650
- should . not . exist ( err ) ;
651
- connection . commit ( function ( err ) {
652
- should . not . exist ( err ) ;
653
- return cb ( ) ;
654
- } ) ;
655
- } ) ;
656
-
657
- inStream . pipe ( lob ) ; // copies the text to the CLOB
658
- }
659
- ) ;
621
+ connection . execute (
622
+ sql ,
623
+ {
624
+ i : id ,
625
+ lobbv : { type : oracledb . BLOB , dir : oracledb . BIND_OUT }
626
+ } ,
627
+ { autoCommit : true } ,
628
+ function ( err , result ) {
629
+ should . not . exist ( err ) ;
630
+ var inStream = fs . createReadStream ( inFileName ) ;
631
+ var lob = result . outBinds . lobbv [ 0 ] ;
632
+
633
+ lob . on ( 'error' , function ( err ) {
634
+ should . exist ( err ) ;
635
+ // ORA-22990: LOB locators cannot span transactions
636
+ ( err . message ) . should . startWith ( 'ORA-22990:' ) ;
637
+ } ) ;
638
+
639
+ inStream . on ( 'error' , function ( err ) {
640
+ should . not . exist ( err , "inStream.on 'error' event" ) ;
641
+ } ) ;
642
+
643
+ lob . on ( 'close' , function ( err ) {
644
+ should . not . exist ( err ) ;
645
+ done ( ) ;
646
+ } ) ;
647
+
648
+ inStream . pipe ( lob ) ; // copies the text to the CLOB
660
649
}
661
- ] , done ) ;
650
+ ) ;
662
651
} ) ; // 80.1.21
663
652
664
653
it ( '80.1.22 works with bind in maxSize smaller than buffer size' , function ( done ) {
0 commit comments