Skip to content

Commit 0c989c8

Browse files
committed
Work on maxSize tests
1 parent d93d86c commit 0c989c8

16 files changed

+1629
-2154
lines changed

test/blobDMLBindAsBuffer.js

Lines changed: 15 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -488,41 +488,7 @@ describe('82.blobDMLBindAsBuffer.js', function() {
488488
], done);
489489
}); // 82.1.14
490490

491-
it('82.1.15 works with Buffer length (5MB + 1)', function(done) {
492-
var id = insertID++;
493-
var contentLength = 5242881; // 5 * 1024 * 1024 + 1;
494-
var specialStr = "82.1.15";
495-
var bigStr = random.getRandomString(contentLength, specialStr);
496-
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
497-
498-
async.series([
499-
function(cb) {
500-
insertIntoBlobTable1(id, content, cb, true);
501-
},
502-
function(cb) {
503-
checkInsertResult(id, content, specialStr, true, cb);
504-
}
505-
], done);
506-
}); // 82.1.15
507-
508-
it('82.1.16 works with Buffer length (10MB + 1)', function(done) {
509-
var id = insertID++;
510-
var contentLength = 10485761; // 10 * 1024 * 1024 + 1;
511-
var specialStr = "82.1.16";
512-
var bigStr = random.getRandomString(contentLength, specialStr);
513-
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
514-
515-
async.series([
516-
function(cb) {
517-
insertIntoBlobTable1(id, content, cb, true);
518-
},
519-
function(cb) {
520-
checkInsertResult(id, content, specialStr, true, cb);
521-
}
522-
], done);
523-
}); // 82.1.16
524-
525-
it('82.1.17 bind value and type mismatch', function(done) {
491+
it('82.1.15 bind value and type mismatch', function(done) {
526492
var id = insertID++;
527493
var content = 100;
528494

@@ -539,12 +505,12 @@ describe('82.blobDMLBindAsBuffer.js', function() {
539505
done();
540506
}
541507
);
542-
}); // 82.1.17
508+
}); // 82.1.15
543509

544-
it('82.1.18 mixing named with positional binding', function(done) {
510+
it('82.1.16 mixing named with positional binding', function(done) {
545511
var id = insertID++;
546512
var contentLength = 40000;
547-
var specialStr = "82.1.18";
513+
var specialStr = "82.1.16";
548514
var bigStr = random.getRandomString(contentLength, specialStr);
549515
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
550516

@@ -566,9 +532,9 @@ describe('82.blobDMLBindAsBuffer.js', function() {
566532
checkInsertResult(id, content, specialStr, true, cb);
567533
}
568534
], done);
569-
}); // 82.1.18
535+
}); // 82.1.16
570536

571-
it('82.1.19 bind with invalid BLOB', function(done) {
537+
it('82.1.17 bind with invalid BLOB', function(done) {
572538
var id = insertID++;
573539

574540
connection.execute(
@@ -583,12 +549,12 @@ describe('82.blobDMLBindAsBuffer.js', function() {
583549
done();
584550
}
585551
);
586-
}); // 82.1.19
552+
}); // 82.1.17
587553

588-
it('82.1.20 Negative: RETURNING INTO with bind type BUFFER', function(done) {
554+
it('82.1.18 Negative: RETURNING INTO with bind type BUFFER', function(done) {
589555
var id = insertID++;
590556
var contentLength = 400;
591-
var specialStr = "82.1.20";
557+
var specialStr = "82.1.18";
592558
var bigStr = random.getRandomString(contentLength, specialStr);
593559
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
594560
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, :c) RETURNING blob INTO :lobbv";
@@ -607,9 +573,9 @@ describe('82.blobDMLBindAsBuffer.js', function() {
607573
done();
608574
}
609575
);
610-
}); // 82.1.20
576+
}); // 82.1.18
611577

612-
it('82.1.21 Negative: RETURNING INTO with autocommit on', function(done) {
578+
it('82.1.19 Negative: RETURNING INTO with autocommit on', function(done) {
613579
var id = insertID++;
614580
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, EMPTY_BLOB()) RETURNING blob INTO :lobbv";
615581
var inFileName = './test/tree.jpg';
@@ -644,12 +610,12 @@ describe('82.blobDMLBindAsBuffer.js', function() {
644610
inStream.pipe(lob); // copies the text to the CLOB
645611
}
646612
);
647-
}); // 82.1.21
613+
}); // 82.1.19
648614

649-
it('82.1.22 works with bind in maxSize smaller than buffer size', function(done) {
615+
it('82.1.20 works with bind in maxSize smaller than buffer size', function(done) {
650616
var id = insertID++;
651617
var contentLength = 32768;
652-
var specialStr = "82.1.22";
618+
var specialStr = "82.1.20";
653619
var bigStr = random.getRandomString(contentLength, specialStr);
654620
var content = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
655621

@@ -672,7 +638,7 @@ describe('82.blobDMLBindAsBuffer.js', function() {
672638
checkInsertResult(id, content, specialStr, false, cb);
673639
}
674640
], done);
675-
}); // 82.1.22
641+
}); // 82.1.20
676642

677643
}); // 82.1
678644

@@ -805,32 +771,5 @@ describe('82.blobDMLBindAsBuffer.js', function() {
805771
], done);
806772
}); // 82.2.5
807773

808-
it('82.2.6 update a column with (10MB + 1) buffer', function(done) {
809-
var id = insertID++;
810-
var contentLength_1 = 50000;
811-
var specialStr_1 = "82.2.6_1";
812-
var bigStr_1 = random.getRandomString(contentLength_1, specialStr_1);
813-
var content_1 = node6plus ? Buffer.from(bigStr_1, "utf-8") : new Buffer(bigStr_1, "utf-8");
814-
var contentLength_2 = 10485761; // 10 * 1024 * 1024 + 1;
815-
var specialStr_2 = "82.2.6_2";
816-
var bigStr_2 = random.getRandomString(contentLength_2, specialStr_2);
817-
var content_2 = node6plus ? Buffer.from(bigStr_2, "utf-8") : new Buffer(bigStr_2, "utf-8");
818-
819-
async.series([
820-
function(cb) {
821-
insertIntoBlobTable1(id, content_1, cb, false);
822-
},
823-
function(cb) {
824-
checkInsertResult(id, content_1, specialStr_1, false, cb);
825-
},
826-
function(cb) {
827-
updateBlobTable1(id, content_2, true, cb);
828-
},
829-
function(cb) {
830-
checkInsertResult(id, content_2, specialStr_2, true, cb);
831-
}
832-
], done);
833-
}); // 82.2.6
834-
835774
}); // 82.2
836775
});

test/blobPlsqlBindAsBuffer_bindin.js

Lines changed: 17 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -726,53 +726,7 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
726726
], done);
727727
}); // 77.1.18
728728

729-
it('77.1.19 works with Buffer size (5MB + 1)', function(done) {
730-
var size = 5242881; // 5 * 1024 * 1024 + 1;
731-
var sequence = insertID++;
732-
var specialStr = "77.1.19";
733-
var bigStr = random.getRandomString(size, specialStr);
734-
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
735-
var bindVar = {
736-
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
737-
b: { val: bufferStr, type: oracledb.BUFFER, dir: oracledb.BIND_IN, maxSize: size }
738-
};
739-
var option = { autoCommit: true };
740-
741-
async.series([
742-
function(cb) {
743-
plsqlBindIn(sqlRun, bindVar, option, true, client11gPlus, cb);
744-
},
745-
function(cb) {
746-
var sql = "select blob_1 from nodb_tab_blob_in where id = " + sequence;
747-
compareBindInResult(sql, bufferStr, specialStr, true, client11gPlus, cb);
748-
}
749-
], done);
750-
}); // 77.1.19
751-
752-
it('77.1.20 works with Buffer size (10MB + 1)', function(done) {
753-
var size = 10485761; // 10 * 1024 * 1024 + 1;
754-
var sequence = insertID++;
755-
var specialStr = "77.1.20";
756-
var bigStr = random.getRandomString(size, specialStr);
757-
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
758-
var bindVar = {
759-
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
760-
b: { val: bufferStr, type: oracledb.BUFFER, dir: oracledb.BIND_IN, maxSize: size }
761-
};
762-
var option = { autoCommit: true };
763-
764-
async.series([
765-
function(cb) {
766-
plsqlBindIn(sqlRun, bindVar, option, true, client11gPlus, cb);
767-
},
768-
function(cb) {
769-
var sql = "select blob_1 from nodb_tab_blob_in where id = " + sequence;
770-
compareBindInResult(sql, bufferStr, specialStr, true, client11gPlus, cb);
771-
}
772-
], done);
773-
}); // 77.1.20
774-
775-
it('77.1.21 works with bind value and type mismatch', function(done) {
729+
it('77.1.19 works with bind value and type mismatch', function(done) {
776730
var sequence = insertID++;
777731
var bindVar = {
778732
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
@@ -790,12 +744,12 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
790744
done();
791745
}
792746
);
793-
}); // 77.1.21
747+
}); // 77.1.19
794748

795-
it('77.1.22 mixing named with positional binding', function(done) {
749+
it('77.1.20 mixing named with positional binding', function(done) {
796750
var size = 50000;
797751
var sequence = insertID++;
798-
var specialStr = "77.1.22";
752+
var specialStr = "77.1.20";
799753
var bigStr = random.getRandomString(size, specialStr);
800754
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
801755
var bindVar = [ sequence, { val: bufferStr, type: oracledb.BUFFER, dir: oracledb.BIND_IN, maxSize: size } ];
@@ -811,9 +765,9 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
811765
compareBindInResult(sql, bufferStr, specialStr, false, client11gPlus, cb);
812766
}
813767
], done);
814-
}); // 77.1.22
768+
}); // 77.1.20
815769

816-
it('77.1.23 works with invalid BLOB', function(done) {
770+
it('77.1.21 works with invalid BLOB', function(done) {
817771
var sequence = insertID++;
818772
var bindVar = {
819773
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
@@ -831,12 +785,12 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
831785
done();
832786
}
833787
);
834-
}); // 77.1.23
788+
}); // 77.1.21
835789

836-
it('77.1.24 works without maxSize', function(done) {
790+
it('77.1.22 works without maxSize', function(done) {
837791
var size = 65535;
838792
var sequence = insertID++;
839-
var specialStr = "77.1.24";
793+
var specialStr = "77.1.22";
840794
var bigStr = random.getRandomString(size, specialStr);
841795
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
842796
var bindVar = {
@@ -854,12 +808,12 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
854808
compareBindInResult(sql, bufferStr, specialStr, false, client11gPlus, cb);
855809
}
856810
], done);
857-
}); // 77.1.24
811+
}); // 77.1.22
858812

859-
it('77.1.25 works with bind in maxSize smaller than buffer size', function(done) {
813+
it('77.1.23 works with bind in maxSize smaller than buffer size', function(done) {
860814
var size = 65535;
861815
var sequence = insertID++;
862-
var specialStr = "77.1.25";
816+
var specialStr = "77.1.23";
863817
var bigStr = random.getRandomString(size, specialStr);
864818
var bufferStr = node6plus ? Buffer.from(bigStr, "utf-8") : new Buffer(bigStr, "utf-8");
865819
var bindVar = {
@@ -877,9 +831,9 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
877831
compareBindInResult(sql, bufferStr, specialStr, false, client11gPlus, cb);
878832
}
879833
], done);
880-
}); // 77.1.25
834+
}); // 77.1.23
881835

882-
it('77.1.26 works with UPDATE', function(done) {
836+
it('77.1.24 works with UPDATE', function(done) {
883837
var proc_7726 = "CREATE OR REPLACE PROCEDURE nodb_blobs_in_7726 (blob_id IN NUMBER, blob_in IN BLOB, blob_update IN BLOB)\n" +
884838
"AS \n" +
885839
"BEGIN \n" +
@@ -890,11 +844,11 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
890844
var proc_drop_7726 = "DROP PROCEDURE nodb_blobs_in_7726";
891845
var sequence = insertID++;
892846
var size_1 = 65535;
893-
var specialStr_1 = "77.1.26_1";
847+
var specialStr_1 = "77.1.24_1";
894848
var bigStr_1 = random.getRandomString(size_1, specialStr_1);
895849
var bufferStr_1 = node6plus ? Buffer.from(bigStr_1, "utf-8") : new Buffer(bigStr_1, "utf-8");
896850
var size_2 = 30000;
897-
var specialStr_2 = "77.1.26_2";
851+
var specialStr_2 = "77.1.24_2";
898852
var bigStr_2 = random.getRandomString(size_2, specialStr_2);
899853
var bufferStr_2 = node6plus ? Buffer.from(bigStr_2, "utf-8") : new Buffer(bigStr_2, "utf-8");
900854
var bindVar = {
@@ -926,7 +880,7 @@ describe('77. blobPlsqlBindAsBuffer_bindin.js', function() {
926880
executeSQL(proc_drop_7726, cb);
927881
}
928882
], done);
929-
}); // 77.1.26
883+
}); // 77.1.24
930884

931885
}); // 77.1
932886

0 commit comments

Comments
 (0)