Table Api Query on Int64 (long) column returning extra results
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- databases
調査の方向性
QueryParser.ts から始め、12L や 13L のような Int64 値を使って報告されたテーブルクエリを再現し、L サフィックスなしの同じクエリの結果と比較します。フィルタリング中に visitNumber の long リテラルがどのように表現され、消費されるかを追跡します。Int64 の範囲クエリが、小さい数値の場合を超える値も含め、一致するエンティティのみを返せば完了です。
索引モデルが issue の本文から書いたものです。
説明
Which service(blob, file, queue, table) does this issue concern?
table
Which version of the Azurite was used?
3.29
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm and ran code from github main
What's the Node.js version?
9.8.1
What problem was encountered?
GET /devstoreaccount1/table()?$filter=PartitionKey%20ne%20%27Current%27%20and%20PlayIndex%20ge%2012L%20and%20PlayIndex%20lt%2013L HTTP/1.1
I do a query and find elements with playindex 12 (expected) but also 120-129 (wrong). This works perfectly fine against azure storage account so is specific to azurite. Also works fine if you drop the L from the query so it treats params as Int32.
Steps to reproduce the issue?
Add entities with a Int64 column and increment +1 each time to new column (add loads) then do a query for less than or equal to a small number and you'll get the extra results.
Have you found a mitigation/solution?
Workaround - dropping the L's off the query does the trick but fearful I may run into trouble on bigger numbers.
Solution attempt - I've had a dig around the code and it is because the filter value 13 is stored as a string as opposed to numeric so I ended up here:
QueryParser.ts
private visitNumber(): IQueryNode {
const token = this.tokens.next(t => t.kind === "number") || this.throwUnexpectedToken("number");
if (token.value!.endsWith("L")) {
// This is a "long" number, which should be represented by its string equivalent
return new ConstantNode(token.value!.substring(0, token.value!.length - 1));
} else {
return new ConstantNode(parseFloat(token.value!));
}
}
Adding a parseInt around the substring makes my case work correctly but the comment above suggests this is wrong, probably due to node numbers being smaller than int64. To try and fix I believe would entail a large code change that unfortunately I don't have the time for.
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 399
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 49
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Azure/Azurite のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Azure/Azurite#2865 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Get Blob with Range bytes=-1 returns 500対応中かも @hippi345 が 9 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
Acquiring a blob lease without a duration causes later requests to return 500対応中かも @hippi345 が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
PUT to a snapshot URL overwrites the base blob対応中かも @hippi345 が 9 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 62/100
Azure/Azurite#2845 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
microsoft/playwright#43640 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
grasshopper-protocol/grsshppr#172 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Tencent/teamai-cli#1397 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
DouyinFE/semi-design#3641 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信