Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[BUG] Statement execute thrown exception doesn't populate the odbcErrors array

Đang mở
#429 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript
Lĩnh vực
database

Hướng nghiên cứu

Bắt đầu từ luồng Statement.execute() và tái hiện lỗi bằng chuỗi prepare, bind và execute đã cung cấp trên DB2 for i bằng cách sử dụng tính năng tracing của unixODBC. So sánh lỗi được ném ra với các chẩn đoán ODBC có sẵn trong quá trình thực thi; hoàn tất khi mảng odbcErrors của lỗi chứa thông tin mô tả lỗi của câu lệnh.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe your system

  • odbc Package 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:

  1. 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

Ngôn ngữ chính
JavaScript
Star
159
Fork
92
Merge trung bình
5 giờ 59 phút
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của IBM/node-odbc

Tất cả issue của IBM/node-odbc

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.