Query KeyConditions with a malformed N value gets HTTP 200, where DynamoDB answers The parameter cannot be converted to a numeric value
I maintainer di solito rispondono entro 5 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust, sqlite
- Ambito
- backend-api-design, databases
Direzione di ricerca
Inizia con desugar_key_conditions in crates/engine/src/legacy_filter.rs e handle_query in crates/engine/src/query.rs, poi leggi validate_and_normalize_number in crates/core/src/validation/number.rs e il controllo del valore dell’espressione nella PR #544. Aggiungi il controllo numerico per i valori N in Legacy KeyConditions prima dell’archiviazione. Il lavoro è completo quando i valori N malformati e vuoti restituiscono HTTP 400 con il testo di errore di DynamoDB, mentre un valore N valido continua a restituire HTTP 200; copri questi casi nei test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 517
- Fork
- 60
- Merge medio
- 4g 23h
- PR unite (30g)
- 134
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ExtendDB/extenddb
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 5 giorni
-
Cassandra: destroy lists no catalog table before --yes, because Cassandra refuses the listing queryAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 5 giorni
Tutte le issue di ExtendDB/extenddb
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
antithesishq/bombadil#473 ·
I maintainer di solito rispondono entro 2 giorni
-
autofixer: follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
tursodatabase/turso#12217 ·
I maintainer di solito rispondono entro 1 giorno
-
Declare the CMS schema library in the optional recipients extraForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaarea:python in-progress
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
yhay81/pyropdf#1005 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
auth-security bug contracts
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno