Query KeyConditions with a malformed N value gets HTTP 200, where DynamoDB answers The parameter cannot be converted to a numeric value
Los mantenedores suelen responder en 5 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust, sqlite
- Área
- backend-api-design, databases
Línea de trabajo
Empieza con desugar_key_conditions en crates/engine/src/legacy_filter.rs y handle_query en crates/engine/src/query.rs; después, lee validate_and_normalize_number en crates/core/src/validation/number.rs y la comprobación del valor de expresión en PR #544. Añade la comprobación numérica para los valores N en Legacy KeyConditions antes de almacenarlos. Se considera terminado cuando los valores N malformados y vacíos devuelvan HTTP 400 con el texto de error de DynamoDB, mientras que un valor N válido siga devolviendo HTTP 200; cubre estos casos en pruebas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 517
- Forks
- 60
- Merge medio
- 4 d 23 h
- PR fusionados (30 d)
- 134
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ExtendDB/extenddb
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 5 días
-
Cassandra: destroy lists no catalog table before --yes, because Cassandra refuses the listing queryAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 5 días
Todos los issues de ExtendDB/extenddb
Issues similares
-
Declare the CMS schema library in the optional recipients extraPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea:python in-progress
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
yhay81/pyropdf#1005 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
auth-security bug contracts
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
Los mantenedores suelen responder en 2 días
-
marketing
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug trading ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
userFRM/egui-charts#3923 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día