Skip to content

Commit c6bd8c8

Browse files
committed
Update tests for 11g
1 parent 6f6baf5 commit c6bd8c8

10 files changed

+79
-35
lines changed

test/binding.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -678,11 +678,16 @@ describe('4. binding.js', function() {
678678
"BEGIN :o := lpad('A',201,'x'); END;",
679679
{ o: { type: oracledb.STRING, dir : oracledb.BIND_OUT } },
680680
function (err, result) {
681-
should.exist(err);
682-
// ORA-06502: PL/SQL: numeric or value error
683-
err.message.should.startWith('ORA-06502:');
684-
// console.log(result.outBinds.o.length);
685-
should.not.exist(result);
681+
if (connection.oracleServerVersion < 1201000200) {
682+
should.not.exist(err);
683+
(result.outBinds.o.length).should.be.exactly(200);
684+
} else {
685+
should.exist(err);
686+
// ORA-06502: PL/SQL: numeric or value error
687+
err.message.should.startWith('ORA-06502:');
688+
// console.log(result.outBinds.o.length);
689+
should.not.exist(result);
690+
}
686691
done();
687692
}
688693
);

test/binding_functionBindInout.js

+2
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ describe('95.binding_functionBindInout.js', function() {
203203
});
204204

205205
it('95.1.2 oracledb.STRING <--> DB: CHAR', function(done) {
206+
if (connection.oracleServerVersion < 1201000200) this.skip();
206207
index++;
207208
var table_name = tableNamePre + index;
208209
var proc_name = procPre + index;
@@ -214,6 +215,7 @@ describe('95.binding_functionBindInout.js', function() {
214215
});
215216

216217
it('95.1.3 oracledb.STRING <--> DB: NCHAR', function(done) {
218+
if (connection.oracleServerVersion < 1201000200) this.skip();
217219
index++;
218220
var table_name = tableNamePre + index;
219221
var proc_name = procPre + index;

test/binding_procedureBindInout.js

+2
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ describe('94.binding_procedureBindInout.js', function() {
200200
});
201201

202202
it('94.1.2 oracledb.STRING <--> DB: CHAR', function(done) {
203+
if (connection.oracleServerVersion < 1201000200) this.skip();
203204
index++;
204205
var table_name = tableNamePre + index;
205206
var proc_name = procPre + index;
@@ -211,6 +212,7 @@ describe('94.binding_procedureBindInout.js', function() {
211212
});
212213

213214
it('94.1.3 oracledb.STRING <--> DB: NCHAR', function(done) {
215+
if (connection.oracleServerVersion < 1201000200) this.skip();
214216
index++;
215217
var table_name = tableNamePre + index;
216218
var proc_name = procPre + index;

test/binding_procedureBindOut.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ describe('96.binding_procedureBindOut.js', function() {
7373
var doTest = function(table_name, procName, bindType, dbColType, content, sequence, nullBind, callback) {
7474
async.series([
7575
function(cb) {
76+
procName = procName + "_1";
7677
var bindVar = {
7778
i: { val: sequence, type: oracledb.NUMBER, dir: oracledb.BIND_IN },
7879
c: { val: content, type: bindType, dir: oracledb.BIND_OUT, maxSize: 1000 }
7980
};
8081
inBind(table_name, procName, sequence, dbColType, bindVar, bindType, nullBind, cb);
8182
},
8283
function(cb) {
84+
procName = procName + "_2";
8385
var bindVar =[ sequence, { val: content, type: bindType, dir: oracledb.BIND_OUT, maxSize: 1000 } ];
8486
inBind(table_name, procName, sequence, dbColType, bindVar, bindType, nullBind, cb);
8587
}
@@ -117,7 +119,6 @@ describe('96.binding_procedureBindOut.js', function() {
117119
"END " + proc_name + "; ";
118120
var sqlRun = "BEGIN " + proc_name + " (:i, :c); END;";
119121
var proc_drop = "DROP PROCEDURE " + proc_name;
120-
// console.log(proc);
121122
var inserted = getInsertVal(dbColType, nullBind);
122123
var insertSql = "insert into " + table_name + " (id, content) values (:c1, :c2)";
123124
async.series([
@@ -215,6 +216,7 @@ describe('96.binding_procedureBindOut.js', function() {
215216
});
216217

217218
it('96.1.2 oracledb.STRING <--> DB: CHAR', function(done) {
219+
if (connection.oracleServerVersion < 1201000200) this.skip();
218220
index++;
219221
var table_name = tableNamePre + index;
220222
var proc_name = procPre + index;
@@ -226,6 +228,7 @@ describe('96.binding_procedureBindOut.js', function() {
226228
});
227229

228230
it('96.1.3 oracledb.STRING <--> DB: NCHAR', function(done) {
231+
if (connection.oracleServerVersion < 1201000200) this.skip();
229232
index++;
230233
var table_name = tableNamePre + index;
231234
var proc_name = procPre + index;

test/blobDMLBindAsBuffer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ describe('82.blobDMLBindAsBuffer.js', function() {
555555
);
556556
}); // 82.1.18
557557

558-
it('82.1.19 Negative: RETURNING INTO with autocommit on', function(done) {
558+
it.skip('82.1.19 Negative: RETURNING INTO with autocommit on', function(done) {
559559
var id = insertID++;
560560
var sql = "INSERT INTO nodb_dml_blob_1 (id, blob) VALUES (:i, EMPTY_BLOB()) RETURNING blob INTO :lobbv";
561561
var inFileName = './test/tree.jpg';

test/clobDMLBindAsString.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ describe('81. clobDMLBindAsString.js', function() {
548548
], done);
549549
}); // 81.1.18
550550

551-
it('81.1.19 Negative: RETURNING INTO with autocommit on', function(done) {
551+
it.skip('81.1.19 Negative: RETURNING INTO with autocommit on', function(done) {
552552
var id = insertID++;
553553
var sql = "INSERT INTO nodb_dml_clob_1 (id, clob) VALUES (:i, EMPTY_CLOB()) RETURNING clob INTO :lobbv";
554554
var inFileName = './test/clobexample.txt';

test/clobPlsqlBindAsString_bindout.js

+39-12
Original file line numberDiff line numberDiff line change
@@ -804,10 +804,19 @@ describe('75. clobPlsqlBindAsString_bindout.js', function() {
804804
connection.execute(
805805
sqlRun,
806806
bindVar,
807-
function(err) {
808-
should.exist(err);
809-
// ORA-06502: PL/SQL: numeric or value error: character string buffer too small
810-
(err.message).should.startWith('ORA-06502:');
807+
function(err, result) {
808+
if (connection.oracleServerVersion < 1201000200) {
809+
should.not.exist(err);
810+
var resultVal = result.outBinds.c;
811+
var resultLength = resultVal.length;
812+
var specStrLength = specialStr.length;
813+
should.strictEqual(resultLength, (len - 1));
814+
should.strictEqual(resultVal.substring(0, specStrLength), specialStr);
815+
} else {
816+
should.exist(err);
817+
// ORA-06502: PL/SQL: numeric or value error: character string buffer too small
818+
(err.message).should.startWith('ORA-06502:');
819+
}
811820
cb();
812821
}
813822
);
@@ -889,10 +898,19 @@ describe('75. clobPlsqlBindAsString_bindout.js', function() {
889898
connection.execute(
890899
sqlRun,
891900
bindVar,
892-
function(err) {
893-
should.exist(err);
894-
// ORA-06502: PL/SQL: numeric or value error: character string buffer too small
895-
(err.message).should.startWith('ORA-06502:');
901+
function(err, result) {
902+
if (connection.oracleServerVersion < 1201000200) {
903+
should.not.exist(err);
904+
var resultVal = result.outBinds[0];
905+
var resultLength = resultVal.length;
906+
var specStrLength = specialStr.length;
907+
should.strictEqual(resultLength, (len - 1));
908+
should.strictEqual(resultVal.substring(0, specStrLength), specialStr);
909+
} else {
910+
should.exist(err);
911+
// ORA-06502: PL/SQL: numeric or value error: character string buffer too small
912+
(err.message).should.startWith('ORA-06502:');
913+
}
896914
cb();
897915
}
898916
);
@@ -1281,10 +1299,19 @@ describe('75. clobPlsqlBindAsString_bindout.js', function() {
12811299
connection.execute(
12821300
sqlRun,
12831301
bindVar,
1284-
function(err) {
1285-
should.exist(err);
1286-
// ORA-06502: PL/SQL: numeric or value error
1287-
(err.message).should.startWith('ORA-06502:');
1302+
function(err, result) {
1303+
if (connection.oracleServerVersion < 1201000200) {
1304+
should.not.exist(err);
1305+
var resultVal = result.outBinds[0];
1306+
var resultLength = resultVal.length;
1307+
var specStrLength = specialStr.length;
1308+
should.strictEqual(resultLength, (len - 1));
1309+
should.strictEqual(resultVal.substring(0, specStrLength), specialStr);
1310+
} else {
1311+
should.exist(err);
1312+
// ORA-06502: PL/SQL: numeric or value error
1313+
(err.message).should.startWith('ORA-06502:');
1314+
}
12881315
cb();
12891316
}
12901317
);

test/plsqlBindIndexedTable2.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,13 @@ describe('44. plsqlBindIndexedTable2.js', function() {
677677
maxArraySize: 3 }
678678
},
679679
function(err) {
680-
should.exist(err);
681-
(err.message).should.startWith('ORA-06502:');
682-
// ORA-06502: PL/SQL: numeric or value error: host bind array too small
680+
if (connection.oracleServerVersion < 1201000200) {
681+
should.not.exist(err);
682+
} else {
683+
should.exist(err);
684+
(err.message).should.startWith('ORA-06502:');
685+
// ORA-06502: PL/SQL: numeric or value error: host bind array too small
686+
}
683687
callback();
684688
}
685689
);

test/resultSet2.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -749,15 +749,15 @@ describe('55. resultSet2.js', function() {
749749
}
750750
);
751751

752-
function fetchRowsFromRS(rs, numRows, done) {
753-
rs.getRows(numRows, function(err) {
754-
should.exist(err);
755-
err.message.should.startWith('NJS-018:'); // invalid result set
756-
done();
757-
});
758-
}
759-
});
760-
});
752+
function fetchRowsFromRS(rs, numRows, done) {
753+
rs.getRows(numRows, function(err) {
754+
should.exist(err);
755+
err.message.should.startWith('NJS-018:'); // invalid result set
756+
done();
757+
});
758+
}
759+
});
760+
});
761761

762762
describe('55.11 result set with unsupported data types', function() {
763763
it('55.11.1 INTERVAL YEAR TO MONTH data type', function(done) {

test/urowidDMLBindAsString_indexed.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ describe('115. urowidDMLBindAsString_indexed.js', function() {
182182
describe('115.3 RETURNING INTO', function() {
183183

184184
it('115.3.1 urowid length > 200', function(done) {
185+
if (connection.oracleServerVersion < 1201000200) this.skip();
185186
var strLength = 200;
186187
var rowidLenExpected = 200;
187188
testBigUROWID_returning(strLength, rowidLenExpected, done);
@@ -247,7 +248,7 @@ describe('115. urowidDMLBindAsString_indexed.js', function() {
247248

248249
});
249250

250-
describe('115.7 queryStream() and oracledb.maxRows < actual rows', function() {
251+
describe.skip('115.7 queryStream() and oracledb.maxRows < actual rows', function() {
251252

252253
it('115.7.1 urowid length > 200', function(done) {
253254
var strLength = 200;
@@ -676,7 +677,7 @@ describe('115. urowidDMLBindAsString_indexed.js', function() {
676677
connection.execute(
677678
"insert into " + tableName_normal + " (ID, content) values (:i, :c) returning content into :o",
678679
bindVar,
679-
function(err) {
680+
function(err, result) {
680681
should.exist(err);
681682
should.strictEqual(err.message, "NJS-016: buffer is too small for OUT binds");
682683
cb();
@@ -781,7 +782,7 @@ describe('115. urowidDMLBindAsString_indexed.js', function() {
781782
},
782783
function(cb) {
783784
var counter = 0;
784-
var sql_select = "select c1, c2, ROWID from " + tableName_indexed + " where ROWID = :c1 or ROWID = :c2";
785+
var sql_select = "select c1, c2, ROWID from " + tableName_indexed + " where ROWID = :c1 or ROWID = :c2 order by c1";
785786
var bindVar = {
786787
c1: { val : urowid_1, dir : oracledb.BIND_IN, type : oracledb.STRING },
787788
c2: { val : urowid_2, dir : oracledb.BIND_IN, type : oracledb.STRING }

0 commit comments

Comments
 (0)