[BUG] callProcedure returns parameter values of incorrect datatype
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
- 領域
- database
調査の方向性
エントリポイント callProcedure から開始し、issue に示されている INOUT と OUT の定義を使って、報告された DB2 for i のケースを再現します。パラメーター値と ODBC プロシージャーデータがどのように変換されるかを追跡します。完了条件は、両方のケースで DECIMAL(11,2) の結果の数値と型に一貫性があり、リポジトリに適切なテスト場所がある場合はリグレッションカバレッジも追加されていることです。
索引モデルが issue の本文から書いたものです。
説明
odbcPackage Version: 2.4.8- ODBC Driver: unixODBC 2.3.9
- Database Name: DB2 for i
- Database Version: V7R5
- Database OS: IBM i
- Node.js Version: v18.20.2
- Node.js OS: IBM i
When using callProcedure I'm finding the returned results don't respect the datatype of the procedure parameters but instead appear to respect the datatype of the Node.js fields.
For example, if I create the following procedure.
DROP PROCEDURE RMTEMP.MY_PROC ;
CREATE PROCEDURE RMTEMP.MY_PROC (
INOUT PARAM1 DECIMAL(11,2) ,
INOUT PARAM2 DECIMAL(11,2) ,
INOUT PARAM3 DECIMAL(11,2) ,
INOUT PARAM4 DECIMAL(11,2)
)
BEGIN
SET PARAM1 = 123.45;
SET PARAM2 = 123.45;
SET PARAM3 = 123.45;
SET PARAM4 = 123.45;
END;
-- CALL RMTEMP.MY_PROC(99.99, 0, '99.99', null);
With the following Node.js code.
const odbc = require('odbc');
odbc.connect('DSN=MYIBMI', (error, connection) => {
if (error) { throw error; }
let param1=99.99;
let param2=0;
let param3='99.99';
let param4=null;
connection.callProcedure(null, 'RMTEMP', 'MY_PROC', [param1, param2, param3, param4], (error, result) => {
if (error) { throw error; }
connection.close();
console.log(result);
});
});
When I call this from Node I'm expecting all four parameters to have a return value of 123.45 (as numbers) but instead I get this. Of particular concern is the second parameter, which is returned as an integer, though I would expect all values to be returned as numbers rather than strings.
[
statement: '{ CALL RMTEMP.MY_PROC (?,?,?,?) }',
parameters: [ 123.45, 123, '123.45', '123.45' ],
return: undefined,
count: 0,
columns: []
]
If I change the procedure to all OUT parameters I get a different result.
DROP PROCEDURE RMTEMP.MY_PROC ;
CREATE PROCEDURE RMTEMP.MY_PROC (
OUT PARAM1 DECIMAL(11,2) ,
OUT PARAM2 DECIMAL(11,2) ,
OUT PARAM3 DECIMAL(11,2) ,
OUT PARAM4 DECIMAL(11,2)
)
BEGIN
SET PARAM1 = 123.45;
SET PARAM2 = 123.45;
SET PARAM3 = 123.45;
SET PARAM4 = 123.45;
END;
Running the same Node.js code I get the following. At least I'm getting the correct values but all of the parameters are returned as strings rather than numbers.
[
statement: '{ CALL RMTEMP.MY_PROC (?,?,?,?) }',
parameters: [ '123.45', '123.45', '123.45', '123.45' ],
return: undefined,
count: 0,
columns: []
]
- 主要言語
- JavaScript
- スター
- 159
- フォーク
- 92
- 平均マージ
- 5時間 59分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
IBM/node-odbc のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
-
security
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
[Bug] Sybase ASE: Encoding issue (works in msnodesqlv8, fails in node-odbc with \x1A artifacts)オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
似ている issue
-
ci-install-db-tools stall-case tests flake: stalled apt-get can be killed before it logs its callオープンeffort:low model:light plan planner:opus-5-5 tests
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
Bug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mozilla-mobile/firefox-ios#35986 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
component:sight
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
agentic-os-org/ANOLISA#6738 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug Durable Agents Observability (AI Telemetry) status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
mastra-ai/mastra#26470 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信