Skip to content

Commit 8e57f96

Browse files
committed
Add negative tests for DML RETURNING
1 parent 84a01ed commit 8e57f96

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

test/dmlReturning.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ describe('6. dmlReturning.js', function(){
343343
);
344344
})
345345

346-
it('6.1.11 Negative test - throws correct error message', function(done) {
346+
it('6.1.11 Negative test - wrong SQL got correct error thrown', function(done) {
347347
connection.should.be.ok;
348348
var wrongSQL = "UPDATE oracledb_dmlreturn SET doesnotexist = 'X' WHERE id = :id RETURNING name INTO :rn";
349349

@@ -362,6 +362,23 @@ describe('6. dmlReturning.js', function(){
362362
}
363363
);
364364
})
365+
366+
it('6.1.12 Negative test - data type is not supported with DML Returning statments', function(done) {
367+
var sql = "UPDATE oracledb_dmlreturn SET name = 'Leslie Lin' WHERE id = :id RETURNING name INTO :rn ";
368+
var bindVar =
369+
{
370+
id: 1002,
371+
rn: { type: oracledb.BUFFER, dir: oracledb.BIND_OUT }
372+
};
373+
374+
connection.execute(sql, bindVar, function(err, result) {
375+
should.exist(err);
376+
// NJS-028: raw database type is not supported with DML Returning statements
377+
(err.message).should.startWith('NJS-028: ');
378+
done();
379+
});
380+
381+
})
365382

366383
}) // 6.1
367384

test/list.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,18 @@
118118
6.1.9 DELETE statement with Array binding
119119
6.1.10 Stress test - support 4k varchars
120120
6.1.11 Negative test - throws correct error message
121+
6.1.12 6.1.12 Negative test - data type is not supported with DML Returning statments
122+
6.2 DATE and TIMESTAMP data
123+
6.2.1 INSERT statement, single row matched, Object binding, no bind in data
124+
6.2.2 INSERT statement with JavaScript date bind in
125+
6.2.3 INSERT statement with Array binding
126+
6.2.4 UPDATE statement with single row matched
127+
6.2.5 UPDATE statements with multiple rows matched, ARRAY binding format
128+
6.2.6 UPDATE statements, multiple rows, TIMESTAMP data
129+
6.2.7 DELETE statement, single row matched, Object binding format
130+
6.2.8 DELETE statement, multiple rows matched, Array binding format
131+
6.2.9 Negative test - bind value and type mismatch
132+
121133

122134
7. autoCommit.js
123135
7.1 autoCommit takes effect when setting oracledb.autoCommit before connecting

0 commit comments

Comments
 (0)