IBM / nodejs-idb-connector

A JavaScript (Node.js) library for communicating with Db2 for IBM i, with support for queries, procedures, and much more. Uses traditional callback-style syntax
MIT License
37 stars 23 forks source link

dbconn.conn() Fails When 4 Arguments are Passed #42

Closed abmusse closed 5 years ago

abmusse commented 5 years ago

Original report by David Russo (Bitbucket: DavidRusso, GitHub: DavidRusso).


In recent versions, calls like this:

dbconn.conn("*LOCAL", "YOUR_USRPRF", "YOUR_PASSWORD", function() {});

Fail with an error like this:

Error: An object was expected at Object. (/home/drusso/idbtest/index.js:5:8) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10) at startup (bootstrap_node.js:204:16) at bootstrap_node.js:625:3

I've attached a simple example that reproduces the error. The code works correctly with version 1.0.13 but fails with any later version, including 1.1.2.

abmusse commented 5 years ago

Original comment by Xu Meng (Bitbucket: mengxumx, GitHub: dmabupt).


I have just uploaded the file for ABI v57.

abmusse commented 5 years ago

Original comment by David Russo (Bitbucket: DavidRusso, GitHub: DavidRusso).


The fix seems to work, although it seems that the prebuilt binary download for ABI v57 (Node.js 8) is missing. Will this binary be supplied?

abmusse commented 5 years ago

Original comment by Xu Meng (Bitbucket: mengxumx, GitHub: dmabupt).


Fixed in 256a288 and you can upgrade idb-connector to 1.1.3 to apply the fix.