node-odbc
node-odbc copied to clipboard
Issues with 2.4.8 on IBM i
Hi,
Binding Parameter Markers breaks when running on IBM I.
I've created a repo that you can use to recreate this issue.
https://github.com/mikemicmike/odbc-example2
If you clone this on windows it will work with no issue. If you run it on IBM i, you will hit a segmentation fault or just no result. Ive looked through the stack trace to no avail.
As soon as you have a bound parameter. however, running this on windows works fine.
Im running on NodeJS 18
This was working great on 2.4.7 but 2.4.8 breaks this entirely.
Thanks
I can't seem to reproduce this one (node 18.18.2, i 7.5, DB2i driver 1.1.0.27):
$ cat index.js
import { connect } from 'odbc';
const w_connectionString = "DSN=*LOCAL"; //
const w_connection = await connect(w_connectionString);
const w_result = await w_connection.query(
`SELECT * From sysibm.sysdummy1 where IBMREQD = ?`, ['Y']).catch(p_error=>{console.log(p_error)});
console.log(w_result);
$ node index.js
[
{ IBMREQD: 'Y' },
statement: 'SELECT * From sysibm.sysdummy1 where IBMREQD = ?',
parameters: [ 'Y' ],
return: undefined,
count: -1,
columns: [
{
name: 'IBMREQD',
dataType: 12,
dataTypeName: 'SQL_VARCHAR',
columnSize: 1,
decimalDigits: 0,
nullable: true
}
]
]
$ npm list
[email protected] /.../odbc-example2
`-- [email protected]
$ node --version
v18.18.2
$ rpm -q ibm-iaccess
ibm-iaccess-1.1.0.27-0.ppc64
$ uname -srv
OS400 5 7
I tested this as well without any issues on IBM i 7.4 with node 18.0.0 and ibm-iaccess-1.1.0.27-0.ppc64
@mikemicmike Since others can't recreate, can you please provide a driver trace?
eg.
cwbtrc /dt:1
# run node recreate
cwbtrc /dt:0
# attach ~/.iSeriesAccess/cwbdetail64-node-XXXXX.csv
testODBC.txt Here is the stack trace above
bash-5.1$ node --version
v18.14.1
bash-5.1$ rpm -q ibm-iaccess
ibm-iaccess-1.1.0.15-0.ppc64
bash-5.1$ uname -srv
OS400 3 7
bash-5.1$
Thanks, but I asked for a driver trace not an ODBC trace.
Looks like it exited out of SQLFetch, however:
[ODBC][799263][1704225649.363390][SQLFetch.c][162]
Entry:
Statement = 1807ce830
[ODBC][799263][1704225649.368336][SQLFetch.c][352]
Exit:[SQL_SUCCESS]
So the problem is either in node-odbc or what the driver is returning. A driver trace might have more information.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.