[BUG] Cursor with fetchSize > 1 results in error on prepared statement
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js, sql
- 領域
- database
調査の方向性
Start by reproducing the prepared-statement path using statement.prepare, statement.execute({ fetchSize: 2 }), and cursor.fetch against SQL Server. Compare it with execution without a prepared statement and trace the cursor handling that produces the "Invalid cursor position" error. Done means fetchSize greater than 1 works with prepared statements and preserves regular cursor behavior.
索引モデルが issue の本文から書いたものです。
説明
Describe your system
odbcPackage Version: 2.4.7- ODBC Driver: Microsoft ODBC Driver Version 18
- Database Name: SQLServer
- Database Version: 2019
- Database OS: Windows
- Node.js Version: 16.15.1
- Node.js OS: Mac OS Ventura 13.3
Describe the bug
The ODBC driver returns a "Invalid cursor position" error if a fetchSize > 1 is specified for a prepared statement in statement.execute.
Expected behavior
Regular cursor behaviour when specifying a fetchSize > 1
To Reproduce
- Create a simple test table: CREATE TABLE test (id int);
- Insert some rows: INSERT INTO test values (1),(2),(3),(4),(5);
- Execute the code as specified below. This will result in the described error.
Code
const odbc = require('odbc');
async function connectToDatabase() {
const connectionConfig = {
connectionString: 'DSN=MSSQL2019;uid=sa;pwd=iRefact2017;MARS_Connection=no;trustServerCertificate=yes',
connectionTimeout: 10,
loginTimeout: 10
};
const connection = await odbc.connect(connectionConfig);
const statement = await connection.createStatement();
await statement.prepare('select * from IR_TSTGIN.dbo.test;');
let cursor = await statement.execute({
fetchSize: 2
});
let result = await cursor.fetch();
await cursor.close();
}
connectToDatabase()
.catch(error => {
console.dir(error, {
depth: null
});
});
Additional context
Specifying a fetchSize without a prepared statement does return as expected. So it seems that something goes wrong with a cursor on a prepared statement.
- 主要言語
- 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
-
難易度 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 日以内に返信
-
liveQuery: a late rejection from an aborted (superseded) query run still reaches observer.errorオープン
難易度 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 日以内に返信