Skip to content

fix(select): add the validation prefix to the ALL_PROJECTED_ATTRIBUTES refusal - #583

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/query-all-projected-prefix
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/query-all-projected-prefix

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

Part of #489 (row O3).

Select=ALL_PROJECTED_ATTRIBUTES without an IndexName now answers with the 1 validation error detected: prefix DynamoDB uses, on Query and on Scan.

What the service answers

Measured on 2026-10-25 at 21:13 and 21:53 UTC in us-east-1, each request sent twice with the same answer:

Request Answer
Query, KeyConditionExpression, no ConsistentRead 1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only when Querying using an IndexName
Query, KeyConditionExpression, ConsistentRead false same
Query, KeyConditionExpression, ConsistentRead true same
Query, legacy KeyConditions same
Scan same

Main sends the sentence without the prefix on all five.

The change

Query and Scan share the refusal in validate_select_projection (crates/core/src/validation/mod.rs), so the text changes there. handle_scan holds a second copy of the sentence after the index lookup. The shared check always answers first for these requests, so that copy is not reached today; it gets the same text so a later reorder of the Scan checks cannot bring the old one back.

Tests

tests/test_select_all_projected_attributes.py: 4 dual-target wire tests, one per measured Query form and one for Scan, asserting the full message.

Run locally on 2026-10-25 against SQLite release builds:

  • at the first commit: the new file 4 passed; on main 4 failed, each on the missing prefix alone;
  • tests/test_query_scan.py (116) and tests/test_wording_parity_validation.py (7) pass at the head and on main; they assert the sentence as a substring;
  • at the head, with the second copy changed: the new file, tests/test_query_scan.py, tests/test_wording_parity_validation.py and every test whose name contains test_scan, 158 passed;
  • cargo +1.97.0 fmt --all -- --check, cargo +1.97.0 clippy -p extenddb-engine -p extenddb-core --all-targets -- -D warnings, and cargo test -p extenddb-engine -p extenddb-core (698 passed).

CI runs the new file in run-integration, run-integration-sqlite, mongodb-pytest and cassandra-pytest.

Not changed here

Measured in the same runs, on main and unchanged by this PR:

  • Query with ALL_PROJECTED_ATTRIBUTES on a table that does not exist: the service answers the sentence above, ExtendDB answers ResourceNotFoundException, because it resolves the table first.
  • Query with ALL_PROJECTED_ATTRIBUTES and AttributesToGet: the service answers 1 validation error detected: Cannot specify the AttributesToGet when choosing to get ALL_PROJECTED_ATTRIBUTES; ExtendDB answers the IndexName sentence.
  • A FilterExpression syntax fault next to ALL_PROJECTED_ATTRIBUTES: both report the filter first, with different wording (Syntax error; token: "=", near: "=" on the service).
  • Scan with ALL_PROJECTED_ATTRIBUTES and a ProjectionExpression: the service prefixes Cannot specify the ProjectionExpression when choosing to get ALL_PROJECTED_ATTRIBUTES; ExtendDB leaves it bare on Scan, and the code comment beside it says the service does. ALL_ATTRIBUTES and COUNT with a ProjectionExpression on Scan were not measured.

Merging

git merge-tree --write-tree adds no conflict against any of the 13 open PRs that change crates/core/src/validation/mod.rs, nor #562, which changes it through its base. #416, #395 and #200 conflict with main in the same files with or without this commit. #481 and #479 assert this sentence with endswith, so their tests pass after this lands; their comments saying ExtendDB omits the prefix become stale.

…S refusal

Amazon DynamoDB answers Select=ALL_PROJECTED_ATTRIBUTES without an IndexName
with `1 validation error detected: ALL_PROJECTED_ATTRIBUTES can be used only
when Querying using an IndexName`, on Query (with a KeyConditionExpression,
with legacy KeyConditions, with ConsistentRead true or false) and on Scan
(measured 2026-10-25 at 21:13 and 21:53 UTC, each request twice). ExtendDB
sent the sentence without the prefix on both. Query and Scan share the
refusal in validate_select_projection, so the text changes there. handle_scan
holds a second copy of the sentence after the index lookup, which the shared
check always reaches first; it gets the same text so a later reorder of the
Scan checks cannot bring the old one back.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants