[BUG] Statement execute thrown exception doesn't populate the odbcErrors array
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- database
调研方向
从 Statement.execute() 路径开始,使用 unixODBC 跟踪,针对 DB2 for i 通过提供的 prepare、bind 和 execute 序列重现该失败。将抛出的错误与执行期间可用的 ODBC 诊断信息进行比较;当错误的 odbcErrors 数组包含描述该语句失败的信息时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Describe your system
odbcPackage Version: 2.4.9- ODBC Driver: 1.1.0.28-0
- unixODBC 2.3.9
- Database Name: DB2 for i
- Database Version: V7R5M0
- Database OS: IBM i
- Node.js Version: 18.18.2
- Node.js OS: IBM i
Describe the bug
The error doesn't contain the odbcErrors data. console.log of the error in a catch block will give you
[Error: [odbc] Error executing the statement] { odbcErrors: [] }
Expected behavior
odbcErrors to have the information about what caused the error
To Reproduce
Steps to reproduce the behavior:
- Run the node.js code below:
Code
try {
const connection = await odbc.connect(my_connection_string);
const statement = await connection.createStatement();
let bindVal = [
field1 || '',
field2 || '']
await statement.prepare(`UPDATE MYLIB.MYTABLE
SET
FIELD1 = ?
WHERE FIELD2 = ?`);
await statement.bind(bindVal);
const result = await statement.execute();
} catch (error) {
console.log(error);
const odbc_error = error?.odbcErrors || 'No ODBC error object';
console.log(odbc_error)
const odbc_error_message = error?.odbcErrors?.[0]?.message || 'No ODBC error message';
console.log(odbc_error_message)
}
Additional context
Checked the following table to find out what the error was but couldn't find anything there either:
qsys2.history_log_info
qsys2.joblog_info
https://github.com/IBM/node-odbc/issues/389 - @harsh-savvient mentioned this issue
https://github.com/IBM/node-odbc/issues/363 - @mikemicmike also raised this issue Dec 21, 2023 and @FredoMartini confirmed it March 1, 2024 and the robot closed the issue May 30, 2024 as stale
https://github.com/IBM/node-odbc/issues/30
- 主要语言
- JavaScript
- 星标
- 159
- 派生
- 92
- 平均合并
- 5 小时 59 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IBM/node-odbc 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
security
难度 3/5 1-2 天 新手友好度 45/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 38/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
gkjohnson/three-mesh-bvh#933 ·
-
scope: curriculum status: waiting triage
难度 2/5 1-3 小时 新手友好度 72/100
freeCodeCamp/freeCodeCamp#71076 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
HarperFast/harper#3275 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
documentation good first issue help wanted
难度 2/5 1-3 小时 新手友好度 75/100
steerion-labs/bounded-agent-runtime#93 ·
维护者通常 1 天内回复