Query KeyConditions with a malformed N value gets HTTP 200, where DynamoDB answers The parameter cannot be converted to a numeric value
メンテナーはふだん 5 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, sqlite
調査の方向性
まず desugar_key_conditions を crates/engine/src/legacy_filter.rs で、handle_query を crates/engine/src/query.rs で確認し、次に crates/core/src/validation/number.rs の validate_and_normalize_number と PR #544 の式値チェックを読みます。保存前に、Legacy KeyConditions の N 値に対する数値チェックを追加してください。不正な N 値と空の N 値が DynamoDB のエラーテキストとともに HTTP 400 を返し、有効な N 値は引き続き HTTP 200 を返すことを完了条件とし、これらのケースをテストでカバーしてください。
索引モデルが issue の本文から書いたものです。
説明
Query on a KEYS_ONLY GSI ngsi with HASH n (N), with the legacy KeyConditions {"n": {"ComparisonOperator": "EQ", "AttributeValueList": [{"N": "abc"}]}}, gets HTTP 200 with Count 0 from ExtendDB. The same request with an empty number, {"N": ""}, gets the same answer.
Amazon DynamoDB answers both requests with HTTP 400 ValidationException:
| Value | DynamoDB |
|---|---|
{"N": "abc"} |
The parameter cannot be converted to a numeric value: abc |
{"N": ""} |
The parameter cannot be converted to a numeric value: (the text ends in a colon and a space) |
With {"N": "1"} both answer HTTP 200 with Count 0. The table has HASH pk and RANGE sk, both S, and holds no items.
The expression form gets the same answers: n = :v with :v set to {"N": "abc"} or {"N": ""} gets HTTP 200 from ExtendDB and the texts above from DynamoDB. #618 lists Query expression values among the values that get no number check, and open PR #544 adds that check for ExpressionAttributeValues.
Measured in us-east-1 on 20 Nov 2026 with signed requests from the AWS SDK for Python, with its parameter validation and retries off. Each request went out twice and got the same answer both times. The ExtendDB answers come from the v1.0.0 release binary on SQLite (npm @extenddb/linux-x64 1.0.0, commit c2e9a32b0), measured the same day with the same requests, twice. origin/main at 2ef56139e changes none of the files named below since v1.0.0.
desugar_key_conditions in crates/engine/src/legacy_filter.rs copies each AttributeValueList value into the key condition's value map as written. In handle_query (crates/engine/src/query.rs), check_key_value_type compares the type descriptor with the key schema and does not read the number. No call to validate_and_normalize_number (crates/core/src/validation/number.rs) reads these values before storage, so the SQLite backend looks up the text abc and finds no row.
Not measured: a RANGE key entry, the other operators, and PostgreSQL, MongoDB and Cassandra. #618 records HTTP 500 for a BatchWriteItem that writes an N sort key abc. I did not check whether this Query answers 200 on the other backends.
Proposed change: check each N value of KeyConditions with the number rules before storage, and answer the texts above. The check for ExpressionAttributeValues in #544 gives the expression form the same answers. The empty value needs the colon and the space that #960 asks for.
- 主要言語
- Rust
- スター
- 517
- フォーク
- 60
- 平均マージ
- 4日 23時間
- マージ済み PR(30日)
- 134
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ExtendDB/extenddb のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 5 日以内に返信
-
Cassandra: destroy lists no catalog table before --yes, because Cassandra refuses the listing queryオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信
ExtendDB/extenddb の issue をすべて見る
似ている issue
-
Declare the CMS schema library in the optional recipients extra対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:python in-progress
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
yhay81/pyropdf#1005 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
auth-security bug contracts
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 2 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug trading ui
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
userFRM/egui-charts#3923 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信