Comparing version 1.2.0 to 1.3.0
# Change Log | ||
## node-oracledb v1.3.0 (15 Oct 2015) | ||
- Added a `oracledb.oracleClientVersion` property giving the version of the Oracle | ||
client library, and a `connection.oracleServerVersion` property giving the Oracle | ||
Database version. | ||
- Fixed `result.outBinds` corruption after PL/SQL execution. | ||
- Fixed null output from DML RETURNING with Oracle Database 11.2 when the string is of size 4000. | ||
- Fixed default bind direction to be BIND_IN. | ||
## node-oracledb v1.2.0 (25 Sep 2015) | ||
@@ -4,0 +16,0 @@ |
{ | ||
"name": "oracledb", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Oracle Database driver by Oracle Corp.", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -1,2 +0,2 @@ | ||
# node-oracledb version 1.2 | ||
# node-oracledb version 1.3 | ||
@@ -3,0 +3,0 @@ ## <a name="about"></a> 1. About node-oracledb |
@@ -678,3 +678,3 @@ /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ | ||
it.skip('4.4.3 Negative - bind out data exceeds default length', function(done) { | ||
it('4.4.3 Negative - bind out data exceeds default length', function(done) { | ||
connection.execute( | ||
@@ -685,2 +685,3 @@ "BEGIN :o := lpad('A',201,'x'); END;", | ||
should.exist(err); | ||
// ORA-06502: PL/SQL: numeric or value error | ||
err.message.should.startWith('ORA-06502:'); | ||
@@ -687,0 +688,0 @@ // console.log(result.outBinds.o.length); |
@@ -151,3 +151,3 @@ /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ | ||
describe('42.3 DML Returning', function() { | ||
describe('42.3 DML Returning - Currently not support RAW', function() { | ||
@@ -180,8 +180,9 @@ before('create table', function(done) { | ||
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
}, | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
// console.log(result); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// NJS-028: raw database type is not supported with DML Returning statements | ||
// (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
@@ -205,7 +206,8 @@ // (result.outBinds.rc[0].length).should.be.exactly(size); | ||
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
{ type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
{ type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
], | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// console.log(result); | ||
@@ -230,7 +232,8 @@ // (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: size * 2 } // should be size | ||
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: size * 2 } // should be size | ||
}, | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// console.log(result); | ||
@@ -256,7 +259,8 @@ // (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
}, | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// console.log(result); | ||
@@ -279,7 +283,8 @@ // (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
{ type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
{ type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
{ type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
], | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// console.log(result); | ||
@@ -302,7 +307,8 @@ // (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
rid : { type: oracledb.NUMBER, dir: oracledb.BIND_OUT }, | ||
rc : { type: oracledb.STRING, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
rc : { type: oracledb.BUFFER, dir: oracledb.BIND_OUT, maxSize: 2000 } | ||
}, | ||
{ autoCommit: true }, | ||
function(err, result) { | ||
should.not.exist(err); | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-028'); | ||
// console.log(result); | ||
@@ -426,2 +432,2 @@ // (result.outBinds.rc[0].toString('hex')).should.eql(bindValue.toString('hex')); | ||
}) | ||
}) |
@@ -250,68 +250,78 @@ /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ | ||
it('3.4.1 executes a query from a JSON table', function(done){ | ||
var data = { "userId": 1, "userName": "Chris" }; | ||
var s = JSON.stringify(data); | ||
var script = | ||
"BEGIN " + | ||
" DECLARE " + | ||
" e_table_exists EXCEPTION; " + | ||
" PRAGMA EXCEPTION_INIT(e_table_exists, -00942); " + | ||
" BEGIN " + | ||
" EXECUTE IMMEDIATE ('DROP TABLE j_purchaseorder'); " + | ||
" EXCEPTION " + | ||
" WHEN e_table_exists " + | ||
" THEN NULL; " + | ||
" END; " + | ||
" EXECUTE IMMEDIATE (' " + | ||
" CREATE TABLE j_purchaseorder ( " + | ||
" po_document VARCHAR2(4000) CONSTRAINT ensure_json CHECK (po_document IS JSON) " + | ||
" )" + | ||
" '); " + | ||
"END; "; | ||
if (connection.oracleServerVersion < 1201000200) | ||
{ | ||
// This example only works with Oracle Database 12.1.0.2 or greater | ||
done(); | ||
} | ||
else | ||
{ | ||
var data = { "userId": 1, "userName": "Chris" }; | ||
var s = JSON.stringify(data); | ||
var script = | ||
"BEGIN " + | ||
" DECLARE " + | ||
" e_table_exists EXCEPTION; " + | ||
" PRAGMA EXCEPTION_INIT(e_table_exists, -00942); " + | ||
" BEGIN " + | ||
" EXECUTE IMMEDIATE ('DROP TABLE j_purchaseorder'); " + | ||
" EXCEPTION " + | ||
" WHEN e_table_exists " + | ||
" THEN NULL; " + | ||
" END; " + | ||
" EXECUTE IMMEDIATE (' " + | ||
" CREATE TABLE j_purchaseorder ( " + | ||
" po_document VARCHAR2(4000) CONSTRAINT ensure_json CHECK (po_document IS JSON) " + | ||
" )" + | ||
" '); " + | ||
"END; "; | ||
connection.should.be.ok; | ||
async.series([ | ||
function(callback){ | ||
connection.execute( | ||
script, | ||
function(err){ | ||
should.not.exist(err); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"INSERT INTO j_purchaseorder (po_document) VALUES (:bv)", | ||
[s], | ||
function(err, result){ | ||
should.not.exist(err); | ||
(result.rowsAffected).should.be.exactly(1); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"SELECT po_document FROM j_purchaseorder", | ||
function(err, result){ | ||
should.not.exist(err); | ||
var js = JSON.parse(result.rows[0][0]); | ||
// console.log(js); | ||
js.should.eql(data); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"DROP TABLE j_purchaseorder", | ||
function(err){ | ||
should.not.exist(err); | ||
callback(); | ||
} | ||
); | ||
} | ||
], done); | ||
} // else | ||
connection.should.be.ok; | ||
async.series([ | ||
function(callback){ | ||
connection.execute( | ||
script, | ||
function(err){ | ||
should.not.exist(err); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"INSERT INTO j_purchaseorder (po_document) VALUES (:bv)", | ||
[s], | ||
function(err, result){ | ||
should.not.exist(err); | ||
(result.rowsAffected).should.be.exactly(1); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"SELECT po_document FROM j_purchaseorder", | ||
function(err, result){ | ||
should.not.exist(err); | ||
var js = JSON.parse(result.rows[0][0]); | ||
// console.log(js); | ||
js.should.eql(data); | ||
callback(); | ||
} | ||
); | ||
}, | ||
function(callback){ | ||
connection.execute( | ||
"DROP TABLE j_purchaseorder", | ||
function(err){ | ||
should.not.exist(err); | ||
callback(); | ||
} | ||
); | ||
} | ||
], done); | ||
}) | ||
@@ -318,0 +328,0 @@ |
@@ -458,3 +458,3 @@ 1. connection.js | ||
58.1.7 autoCommit | ||
58.1.8 version | ||
58.1.8 version (read-only) | ||
58.1.9 connClass | ||
@@ -465,2 +465,3 @@ 58.1.10 externalAuth | ||
58.1.13 lobPrefetchSize | ||
58.1.14 oracleClientVersion (read-only) | ||
58.2 pool properties | ||
@@ -473,7 +474,8 @@ 58.2.1 poolMin | ||
58.3 connection properties | ||
58.3.1 Connection object intial toString values | ||
58.3.2 stmtCacheSize | ||
58.3.3 clientId | ||
58.3.4 action | ||
58.3.5 module | ||
58.3.1 Connection object initial toString values | ||
58.3.2 stmtCacheSize (read-only) | ||
58.3.3 clientId (write-only) | ||
58.3.4 action (write-only) | ||
58.3.5 module (write-only) | ||
58.3.6 oracleServerVersion (read-only) | ||
@@ -480,0 +482,0 @@ 59. lob.js |
@@ -147,3 +147,3 @@ /* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */ | ||
it('58.1.8 version', function() { | ||
it('58.1.8 version (read-only)', function() { | ||
(oracledb.version).should.be.a.Number; | ||
@@ -196,2 +196,15 @@ | ||
}) | ||
it('58.1.14 oracleClientVersion (read-only)', function () { | ||
var t = oracledb.oracleClientVersion ; | ||
t.should.be.a.Number; | ||
try { | ||
oracledb.oracleClientVersion++; | ||
} catch(err) { | ||
should.exist(err); | ||
(err.message).should.startWith('NJS-014'); | ||
} | ||
} ); | ||
}) // 58.1 | ||
@@ -299,3 +312,3 @@ | ||
it('58.3.1 Connection object intial toString values', function() { | ||
it('58.3.1 Connection object initial toString values', function() { | ||
connection.should.be.an.Object; | ||
@@ -311,3 +324,3 @@ | ||
it('58.3.2 stmtCacheSize', function() { | ||
it('58.3.2 stmtCacheSize (read-only)', function() { | ||
var t = connection.stmtCacheSize; | ||
@@ -324,3 +337,3 @@ t.should.be.a.Number; | ||
it('58.3.3 clientId', function() { | ||
it('58.3.3 clientId (write-only)', function() { | ||
try { | ||
@@ -343,3 +356,3 @@ var t = connection.clientId; | ||
it('58.3.4 action', function() { | ||
it('58.3.4 action (write-only)', function() { | ||
@@ -363,3 +376,3 @@ try { | ||
it('58.3.5 module', function() { | ||
it('58.3.5 module (write-only)', function() { | ||
@@ -383,3 +396,16 @@ try { | ||
it('58.3.6 oracleServerVersion (read-only)', function () { | ||
var t = connection.oracleServerVersion; | ||
t.should.be.a.Number; | ||
try { | ||
connection.oracleServerVersion++; | ||
} | ||
catch (err) { | ||
should.exist ( err ); | ||
(err.message).should.startWith('NJS-014'); | ||
} | ||
}); | ||
}) // 58.3 | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
896465
95
12187