Repository navigation
fix(query): check Query values against the key schema and the number rules - #544
Merged
Merged
Conversation
…rules
A Query with a KeyConditionExpression did not check a key condition value's
type against the key attribute's AttributeDefinitions type, and did not check
that an N value in ExpressionAttributeValues is a number. The storage layer
compared the value's inner text with the stored key and ignored the type tag,
so {"N": "bob"} on an S partition key read the bob partition while
authorization bound no dynamodb:LeadingKeys value to it, and a sort key value
of another type answered InternalServerError on SQLite.
Add the two checks the service applies before it reads a row, on the
expression path (crates/engine/src/query_key_values.rs):
- an N value in ExpressionAttributeValues that is not a number answers
"The parameter cannot be converted to a numeric value: <value>" (the
overflow and 38-digit texts for those cases; an empty value answers the
message with the colon). The check covers the whole map, including NS
members and values nested in L and M, whether the key condition, the
filter or nothing reads them, with the walk PutItem and UpdateItem already
use. It runs at request time after the Limit and expression parameter mix
checks and before the table lookup, which moves those two checks ahead of
the table lookup as well. The server runs the same request-time checks
ahead of the IAM decision, so a principal under any LeadingKeys fence form
gets ValidationException and no items;
- a key condition value whose type is not the key attribute's type answers
"One or more parameter values were invalid: Condition parameter type does
not match schema type", for the partition key, the sort key under every
comparison operator, both BETWEEN bounds, the begins_with prefix and
multi-attribute index keys, after the key schema, filter, projection,
unused value and Select checks and before the ExclusiveStartKey check. When
a compared placeholder is undefined the check returns without a verdict and
the undefined placeholder is reported.
Measured on the service on 2026-10-24 (113 requests, each sent twice). The
legacy KeyConditions path is unchanged; its checks land with #507. Scan is
unchanged. Unit tests at the checks and a dual-target wire test file,
tests/test_query_key_value_types.py, which fails on main.
… service's order The server ran its pre-IAM checks only when the body deserialized as QueryInput, and the engine checked the ReturnConsumedCapacity and Select enums before them, so a Query carrying an invalid Select and an N value that is not a number answered the Select message, or AccessDeniedException for a principal whose LeadingKeys fence needs a value. The checks now read the raw body in the service's order, measured 2026-10-24: Limit, the expression and non-expression parameter mix, ReturnConsumedCapacity, every number in ExpressionAttributeValues, then Select. The engine and the server run the same function.
LeeroyHannigan
requested review from
amrith,
c33howard,
jcshepherd,
pdf-amzn,
robinnsc and
yesyayen
as code owners
October 25, 2026 03:43
…y sentence matches the other backends
…ort a shape fault ahead of the request-time checks The request-time number check refused an N value written with a Unicode decimal digit (fullwidth, Arabic-Indic, Devanagari) that the service accepts as the digit it stands for, so a Query that returns rows on the service answered ValidationException here. The check now folds every general category Nd digit to ASCII before the number rules run and echoes the value as the request wrote it when the rules refuse it; the Nd zero code points of Unicode 15.0 live in a module of their own. The fold applies to the check only: the handler and the server's key binding read the value as written. The write paths are unchanged. The checks run on the raw body before deserialization, so a field of the wrong JSON type elsewhere in the body (a string ExpressionAttributeValues beside a Limit of 0, a string ExpressionAttributeNames beside a malformed N, a numeric Select) answered the check's ValidationException where the service and the previous release answered SerializationException. When a check fails, the body is now deserialized as the typed input and a SerializationException from that is returned instead; a ValidationException the deserializer raises does not preempt the check, and a body that passes every check is not deserialized twice. The server's call before dispatch goes through the same function. Measured against the service on 2026-10-25 (11:31 UTC) on tables with S/N and S/S keys, each request twice. Unit tests cover the digit table, the folded check and the shape-fault order; the wire file gains the measured rows for both.
…ks, and assert only acceptance for Unicode digits
The shape-fault pass returned the deserializer's SerializationException for an
AttributeValue with an unknown type descriptor, so Limit 0 beside {"X": "1"}
changed class. The service answers the Limit ValidationException for that
body (measured 2026-10-25), and the check's answer is returned again.
The Unicode digit tests asserted that a key condition or filter written with
a Unicode digit reads the item stored with the ASCII digit. This change makes
the request-time check accept such a value; it does not change how the
handler reads it, so the tests assert only that the value is accepted. A new
test checks that a partition key value written with Unicode digits returns no
item of a partition a ForAllValues LeadingKeys fence keeps the caller from.
This was referenced Oct 25, 2026
fix(query): classify and order key conditions on a multi-attribute GSI the way the service does
#429
Merged
This was referenced Nov 3, 2026
Conflict in crates/server/src/request_helpers.rs (authorize_request): main moves the ARN shape checks and the GetRecords iterator decode ahead of the dev-mode return. The resolution keeps the main version and puts the Query request checks of this branch after the tag ARN shape check and before validate_operation_arns. Thus the Query checks also run in dev mode.
Main changes resolve_multipart to take the HASH and the RANGE attribute names (#429). The multi-attribute HASH test now gives r as the RANGE attribute, as its attribute definitions do.
…l as the service does On a single-attribute key schema, the later check of this branch now reports a wrong type in a key condition expression, as the service does. The early check from main still runs there for legacy KeyConditions, which the later check skips. The begins_with refusal now reads the type of the value instead of the type of the sort key.
…rder comments Two new rows send begins_with with an N value on an attribute that is not in the key schema. One row uses a table with an S sort key and the other uses a table with an N sort key. The service refuses both requests with the begins_with operand type message. The comments in handle_query now say that the classifier checks the values of legacy KeyConditions. They also say which attribute definitions it uses for each kind of key schema. The doc of resolve_key_schema_with now says where the service reports a wrong type on a single-attribute key schema (measured 2026-11-06).
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 80490c6, eight commits after the last merge (#596, #1173, #398, #428, #544, #567, #584 and #588). One file conflicted: crates/engine/src/query.rs. #544 moves the Limit check and the parameter mix check of Query into validate_query_request_body, which reads the raw body before deserialization. This branch moves the same two checks to the start of the handler, after deserialization. The merge keeps the checks of #544 and drops the copies of this branch, which no request can reach. It keeps has_cond_op for the ConditionalOperator check. The conflict hunks in handle_query: - At the old Limit check, both sides remove the check. The merge keeps the comment of #544. - Next, this branch keeps the variables of the mix check, and main keeps the index key schema. The merge keeps the key schema where this branch has it. It drops the mix check variables, which nothing reads now, and keeps the comment of #544 and has_cond_op. - Before the ExclusiveStartKey check, this branch removes the filter operand checks, because its semantic pass runs them at parse time. #544 adds validate_key_condition_types there. The merge keeps the type check and drops the filter checks. #544 refuses a begins_with value that is not an S or a B ahead of an unused value (rows q5 and p4 of tests/test_query_key_value_types.py, measured 2026-11-06). This branch checks unused values before the table lookup, so the merged code gave the unused value message for those two rows. The merge calls refuse_begins_with_on_number after the key condition parse and removes the later call. The values of legacy KeyConditions pass validate_legacy_conditions before that point. Git merged four other files that both sides change, with no overlap: crates/core/src/expression/key_condition.rs, crates/engine/src/lib.rs, crates/storage-cassandra/tests/common/mod.rs and docs/differences-from-dynamodb.md.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 80490c6, six commits after the last merge (#398, #428, #544, #567, #584 and #588). Two files conflicted. crates/engine/src/lib.rs: this branch adds query_key_size_tests and #544 adds query_key_values to the module list. The merge keeps both in name order. crates/engine/src/query.rs, two hunks in handle_query: - This branch moves validate_query_select_index_support after the start key checks, and #544 replaces the Limit check with a comment. The merge removes the early Select check and keeps the comment of #544. - Before the ExclusiveStartKey check, this branch adds validate_query_key_sizes and #544 adds validate_key_condition_types. The merge runs the type check first, because the key size comment records a wrong-typed key value ahead of the size (measured 2026-10-23). On a single-attribute key schema #544 checks the type there and not in resolve_key_schema_with, so the key size comment now says "checked above".
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
…te tests #544 adds a TableKeyInfo literal to the test context of crates/engine/src/query_gate_tests.rs. This branch adds the creation_date_time field to TableKeyInfo, so the engine tests do not compile after the merge of main at 80490c6. The literal now sets creation_date_time to 0.0, as the other test literals on this branch do.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 80490c6, six commits after the last merge (#398, #428, #544, #567, #584 and #588). One file conflicted: crates/engine/src/query.rs. This branch moves the table lookup, the index lookup and the index key schema below the request-stage checks. #544 moves the Limit check and the parameter mix check into validate_query_request_body, which reads the raw body before deserialization. Three conflict hunks in handle_query follow from this: - After deserialization, this branch keeps the Limit check and main keeps the table lookup. The merge keeps the lookup where this branch has it and puts the comment of #544 in place of the Limit check. - Next, this branch keeps the variables of the mix check and main keeps the index key schema. The merge keeps the key schema where this branch has it. It drops the mix check variables, which nothing reads now, and keeps the comment of #544 and has_cond_op. - Before the ExclusiveStartKey check, this branch removes the filter operand checks, because its semantic pass runs them at parse time. #544 adds validate_key_condition_types there. The merge keeps the type check and drops the filter checks. #544 refuses a begins_with value that is not an S or a B ahead of an unused value (rows q5 and p4 of tests/test_query_key_value_types.py, measured 2026-11-06). This branch checks unused values before the table lookup, so the merged code gave the unused value message for those two rows. The merge calls refuse_begins_with_on_number after the key condition parse and removes the later call. The values of legacy KeyConditions pass validate_key_conditions before that point. Git merged four other files that both sides change, with no overlap: crates/core/src/expression/key_condition.rs, crates/engine/src/lib.rs, docs/differences-from-dynamodb.md and crates/engine/src/decimal_digits.rs, which both sides add with the same content.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
…te tests #544 adds a TableKeyInfo literal to the test context of crates/engine/src/query_gate_tests.rs. The commits of #399 on this branch add the creation_date_time field to TableKeyInfo. So the engine tests do not compile after the merge of main at 80490c6. The literal now sets creation_date_time to 0.0, as the other test literals on this branch do.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/engine/src/query_key_values.rs: this branch makes two constants and four functions pub(crate) for the Scan checks, and re-exports three functions of unreadable.rs. It reads a number in Segment and TotalSegments as it reads one in Limit, with the dates in the doc comment of shape_fault_first. It passes validate_no_parameter_mix to unreadable_value_checks. - crates/engine/src/query_key_values/unreadable.rs: this branch makes three functions pub(crate). unreadable_value_checks takes the parameter mix check as a parameter, so this branch deletes the import of validate_no_parameter_mix. - crates/server/src/request_helpers.rs: this branch runs the Scan request checks before the IAM decision, as main does for Query. - tests/test_query_leading_keys_values.py: this branch moves the setup of TestLeadingKeysWithAnInvalidKeyValue to the base class ManagementPrincipals, which tests/test_scan_checks_before_authorization.py imports. Git merged crates/engine/src/lib.rs with no conflict. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds the module scan_request and changes the doc comment of validate_enum_fields.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/engine/src/query_key_values.rs: the dates and the order in the module and function doc comments, the call of validate_condition_value_numbers, and the two functions validate_condition_value_numbers and refuse_first_fault. - crates/engine/src/query_key_values/request_order_tests.rs: the import of Value and the test legacy_condition_values_get_the_number_check. - tests/test_query_key_value_types.py: the dates in the docstring, the nn_table fixture and the helpers eq, N1, KC_ABC and QF_BOB. The merge also keeps the rows k1 to k16, and nn_table in the tables fixture and the control test. Git merged crates/engine/src/lib.rs with no conflict. This branch changes that file only through the commits of #544, so the merged file is the file of main.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is at 14ade59. This branch last had main at 018715e, through fix/query-key-value-types. Since then, these eleven commits merged into main: #1280, #1009, #596, #1173, #398, #428, #544, #567, #584, #588 and #864. #544 is the squash of fix/query-key-value-types, which was the base branch of this PR. This branch already holds the last head of that branch, 31c5f3d. Main has the same version of each conflicted file as 31c5f3d. So each conflict hunk has the lines of #544 on one side. The other side has the change of this branch to the same lines. The merge keeps the version of this branch in each file: - crates/core/src/partiql/params.rs: this branch deletes the two base64 imports, because decode_base64 replaces check_base64. - crates/core/src/types/attribute_value.rs: this branch adds BASE64_TEXTS, decode_base64 and is_base64_refusal after the two constants that #544 makes public. - crates/core/src/types/mod.rs: this branch adds decode_base64 and is_base64_refusal to the names that #544 re-exports. - tests/test_query_leading_keys_values.py and tests/test_query_value_shapes.py: this branch moves _raw_query to tests/raw_signed_request.py as client_post, and calls client_post in its place. No other test file on main calls _raw_query. Git merged crates/engine/src/lib.rs with no conflict. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds serialization_exception and calls it from deserialize_error.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
The base merges main at 14ade59. That brings #544 as a squash and ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584, #588 and #864. One file conflicted: crates/engine/src/import_export.rs. #1009 moves the body of handle_import_table to import_table in the new file crates/engine/src/import_export/files.rs. The wasm32 build replaces that file with a stand-in that refuses the operation. handle_import_table keeps the enabled check and calls files::import_table. This branch changes the body that #1009 moves. When read_items finds a line that it cannot read, the import keeps the items before that line. It counts the line as one error and reads no more of the file. The merge keeps the code of main in import_export.rs, with the doc comment of this branch on handle_import_table. It makes the three changes of this branch to the body in files.rs: - The variable read holds the result of read_items: the items and the line that the reader cannot read. - The loop takes the items, then that line. At that line it logs the line number and the fault, counts one error and ends the import. - The comment over the FAILED status adds the date 2026-11-22, for the lines that the import cannot read. The body of import_table in files.rs is now the same as the body of handle_import_table at the head of this branch. Git merged docs/manuals/07-upgrade-manual.md with no conflict. #398 adds its v1.1.0 entry at the top of "Behavior Changes by Release". This branch adds its v1.1.0 entry at the end of that section.
6 of 8 tasks
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
The base merges main at 14ade59. That brings #544 as a squash and ten other commits: #1280, #1009, #596, #1173, #398, #428, #567, #584, #588 and #864. The merge has no conflict. Git merged crates/engine/src/lib.rs, the one file with changes on both sides. Main compiles three modules only off wasm32 (backup, import_export_io and private_fs), and adds the modules backup_requests and pre_dispatch. This branch adds single_write_refusal after deserialize_error.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
#544 moved the enum checks of handle_query into query_key_values::validate_query_request_body, which runs before typed deserialization. The merge takes that call from main and keeps this branch's query_scan_deserialize_error for the deserialization error.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
#544 moved the enum checks of handle_query into query_key_values::validate_query_request_body, which runs before typed deserialization. The merge takes that call from main and keeps this branch's read_input, which answers a missing TableName before the other members.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
#544 moved has_equal_numbers and NUMBER_SET_DUPLICATES from partiql/params.rs to validation::number, and this branch moved check_parameter_types to serde_helpers. After the merge, params.rs uses neither the base64 imports from main nor the HashSet import from this branch. The merge drops both.
4 of 8 tasks
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
Main is 10 commits ahead of the branch. Two files conflicted. docs/manuals/07-upgrade-manual.md: both sides add a v1.1.0 entry at the same place. Both stay, main's #398 entry first. crates/engine/src/query.rs: #544 (1ddc087) moved the Limit, enum, parameter mix, names and number checks of a Query into query_key_values::validate_query_request_body. That function reads the raw body before deserialization and before the IAM decision. This branch runs its checks in query::request_checks::check_request. The three conflict regions take this branch's side. handle_query reads the request through check_request, and the empty key condition, parameter usage and ConditionalOperator checks stay in check_request_parameters. check_request now starts with validate_query_request_body and drops its own copies of the ReturnConsumedCapacity enum check and the Limit check. check_request_parameters drops its copy of the parameter mix check. The copies of #544 merged first. The Select enum check moves out of validate_query_request_body into validate_query_select, which check_request runs after the FilterExpression and KeyConditionExpression checks, with the same shape fault rule. The measured rows settle the order. An undefined filter name (H3) and a second condition on one key attribute (B4) answer ahead of an invalid Select. An N value that is not a number (f1 of #544) and a Limit of 0 (L7, f3) answer ahead of it. The server's check before the IAM decision no longer includes Select. A principal the policy denies, with an invalid Select, now gets AccessDeniedException where main gave the Select text. That answer is not measured. Both PRs refuse a begins_with value that is not a string or a binary value. This branch's parser check stays, because the measured rows put that refusal ahead of the duplicate check (D3) and in the parse (E1, P1). handle_query now calls refuse_begins_with_on_number (#544) for a legacy KeyConditions request only, so a KeyConditionExpression is not checked twice. Two unit tests of #544 that read the Select answer from validate_query_request_body now read it from validate_query_select.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
The merge of main moved the Select check behind the FilterExpression and KeyConditionExpression checks. The check that the server makes before the IAM decision then no longer covered Select. A principal the policy denies got AccessDeniedException for an invalid Select. Main gives that principal the Select text, because #544 checks Select before the IAM decision. refuse_duplicate_key_condition now runs check_request for an invalid Select too. Every principal gets the Select text, or a fault that check_request reports ahead of it. The measured rows still hold. An undefined filter name (H3) and a duplicate (B4) answer ahead of an invalid Select. No row measures the answer for a principal the policy denies. The new test an_invalid_select_is_refused_before_authorization sends pk = :own and pk > :own with Select BOGUS, and the shape of H3. It also deletes the three comment lines above the validate_query_request_body call in check_request, which repeated the list of checks in that function's doc.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 25, 2026
The branch of #484 merged main at 5252eda, which adds #544 (1ddc087). Its next commit, 468b256, refuses an invalid Select before the IAM decision. One file conflicted, crates/engine/src/query.rs, in three places. The key schema checks of handle_query: this branch runs them only when the key condition has an equality on the HASH attribute. #544 runs the classifier's type check only on a multi-attribute key schema or for legacy KeyConditions, and #484's branch calls refuse_begins_with_on_number for legacy KeyConditions only. The resolution keeps this branch's guard around their code, and this branch's missed_key_schema_element helper. refuse_without_hash_equality, beside the new doc of check_request_parameters: both stay. The engine refusal drops its call of refuse_begins_with_on_number. With #544 that function refuses a begins_with value that is not a string or a binary value. The parse refuses that value before the table lookup, and lacks_hash_equality holds only for a KeyConditionExpression, so the call could not fail. Rows 6 and the two begins_with rows of 1 November in test_query_lone_non_equality.py stay, and the parse answers them. The test modules: all three stay. The code that only that call needed goes too. KeyCondition::without_equality put a second clause that is a begins_with into sk_condition, where the engine refusal read it. It now keeps the first clause there. Two engine tests called the refusal with a begins_with on a number key: this merge deletes one, and the other keeps its row 6b.
4 of 8 tasks
6 of 8 tasks
robinnsc
added a commit
that referenced
this pull request
Nov 26, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has two features (#468, #1009) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #503, #544, #567, #765 and #774, #588, #596, #690, #1144, #1173 and #1194, next to the existing entries for #398 and #526. The #526 entry now gives the old TransactWriteItems mismatch message, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone. Signed-off-by: Scott Robinson <robinnsc@amazon.com>
robinnsc
added a commit
that referenced
this pull request
Nov 26, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has two features (#468, #1009) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194 and #1375, next to the existing entries for #398, #526 and #1166. The #526 entry now gives the old TransactWriteItems mismatch message, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone.
robinnsc
added a commit
that referenced
this pull request
Nov 27, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone.
robinnsc
added a commit
that referenced
this pull request
Nov 27, 2026
Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone. docs/troubleshooting.md: the bus error entry names 1.0.0 as the release that has the bug, so its line carries a version-literal-ok marker.
LeeroyHannigan
added a commit
that referenced
this pull request
Nov 27, 2026
* chore(release): bump version to 1.1.0 Moves the workspace version from 1.0.0 to 1.1.0 on every surface that carries it: the root Cargo.toml version and its 13 exact pins, the 15 workspace entries in Cargo.lock (no third-party entry changes), packaging/npm/package.json (the version and the five platform pins), the four license-notice files (regenerated with cargo-about 0.9.0), and the sample `extenddb version` and `serve` output in docs/getting-started.md and docs/manuals/04-quickstart-setup-guide.md. This is a minor release. Since v1.0.0, main has three features (#468, #1009, #1449) and changes that make ExtendDB answer as DynamoDB does, which docs/versioning.md ships in a minor release. It adds no catalog migration (RELEASED_THROUGH stays 12, the last id), no configuration key and no backup format version. Upgrade manual, Behavior Changes by Release: v1.1.0 entries for #468 (AT_TIMESTAMP, and the GetShardIterator answers it changes), #486, #503, #544, #567, #765 and #774, #588, #596, #690, #963, #1144, #1173, #1194, #1375 and #1522, next to the existing entries for #398, #526, #1166, #1449 and #1523. The #526 entry now gives the old TransactWriteItems mismatch message, the #1523 heading takes the v1.1.0: prefix, and the entries are in PR order. Current Status, the General Upgrade Procedure and the Rollback Procedure cover 1.0.0 to 1.1.0: no migrate step, the #1166 checks before a PostgreSQL upgrade, and a rollback runs the 1.0.0 binary on the same catalog, with the two limits the manual names (#526 tokens, and 1.0.0's catalog-check --fix). The rollback note of the KEK-file switch says that 1.0.0 serves a switched catalog. docs/manuals/11-deployment-guide.md: a sentence about the release before the one that carries #398 is gone. docs/troubleshooting.md: the bus error entry names 1.0.0 as the release that has the bug, so its line carries a version-literal-ok marker. * docs(upgrade): add the v1.1.0 entry of #1290, put #1349's in order #1290 merged after this branch was rebased. It changes the answer to a request with no Authorization header, so it gets a v1.1.0 entry. The merge of main put the #1349 entry after the #1523 entry. It moves to the place of its number, beside the new #1290 entry. --------- Co-authored-by: Lee Hannigan <29015211+LeeroyHannigan@users.noreply.github.com>
4 of 8 tasks
5 of 8 tasks
parsnips
pushed a commit
to parsnips/extenddb
that referenced
this pull request
Dec 4, 2026
…endDB#481) * fix(query): refuse key condition values over the key size limits Closes ExtendDB#435. The service refuses a Query whose key condition values exceed the key size limits before it reads anything; ExtendDB ran the Query. Measured on 2026-10-23, every row repeated with identical answers: - A HASH value over 2048 bytes: "One or more parameter values were invalid: Size of hashkey has exceeded the maximum size limit of2048 bytes" (no space after "of", as the service writes it). 2048 bytes is accepted. - HASH values that each fit but add up to more than 2048 bytes (an index with two HASH attributes): "One or more parameter values were invalid: Aggregated size of all hash keys has exceeded the size limit of 2048 bytes". A sum of exactly 2048 is accepted. A single oversized value gets the single sentence even when the sum is also over. - RANGE values adding up to more than 1024 bytes, one clause or several: "One or more parameter values were invalid: Aggregated size of all range keys has exceeded the size limit of 1024 bytes". 1024 is accepted. Every operator is sized (=, <, <=, >, >=, begins_with); BETWEEN contributes its larger bound, not the sum of both. - The HASH checks are reported before the RANGE check. - Strings are sized by UTF-8 bytes (683 U+20AC characters, 2049 bytes, refused; 682 plus "xx", 2048 bytes, accepted) and binary values by byte length. Base tables, LSIs, GSIs and legacy KeyConditions behave the same. - An undefined #name or :value in the key condition is reported before the size check. Ordering, measured with a 2049-byte value: filter syntax, unused names and values, index name, ConsistentRead on a GSI, missing table, Limit, projection syntax and overlap, the Select conflicts and the filter operand type are all reported first; the ExclusiveStartKey checks after. The check is crates/core/src/validation/key_size.rs, called from handle_query after the expression validations and before the start key checks. The limits come from the configuration and the sentences name them. Tests: unit tests in validation/key_size/tests.rs and the engine; tests/python/test_query_key_size.py, test_query_key_size_values.py and test_query_key_size_order.py (64 rows) pass against the service. On ExtendDB alone, five rows with two or more RANGE clauses on one index skip until the multi-attribute range change in ExtendDB#429 merges (the handler refuses the shape earlier today); they pass on the merged tree. The undefined-name row stays unit level because the undefined-name refusal for a sort key clause arrives with ExtendDB#479. Pre-existing, measured, not changed here: a BETWEEN with the lower bound above the upper bound is refused by the service with a bound-order sentence; two conditions on one key are refused with "KeyConditionExpressions must only contain one condition per key"; a Number with 39 or more digits is refused with "Attempting to store more than 38 significant digits in a Number"; a FilterExpression on a key attribute is refused with "Filter Expression can only contain non-primary key attributes". ExtendDB accepts all four. * fix(cassandra): pass the bare index name in IndexNotFound so the Query sentence matches the other backends * test(query): skip the idx accept rows on a backend that cannot read a multi-RANGE index The Cassandra backend answers InternalServerError to any Query on an index with several RANGE attributes: its ORDER BY lists sk_* then base_pk and skips the sk2_* to skN_* clustering columns, which Cassandra refuses with "Order by currently only supports the ordering of columns following their declared order in the PRIMARY KEY". require_multi_range now also skips on InternalServerError, so test_one_600_byte_range_value_is_accepted carries the probe like the other idx rows. * test(query): skip later-RANGE accept rows on first-RANGE-only backends Since ExtendDB#429, the MongoDB and Cassandra backends refuse a key condition on a later RANGE attribute of a multi-attribute index with a ValidationException. Two rows of TestGsiQueryKeySize expect such a Query to be served, and they failed on MongoDB. They now skip when a probe gets that refusal, as the multi-range tests on main do. The refusal rows still run on those backends, because the size check answers first. * fix(core): read the key byte size through the key_size module in restorable_item Main added validation/restorable_item.rs, which sizes a backup item's key with key_value_byte_size from the validation module. This branch moved that function into validation/key_size.rs. The call now names the new module, as check_key_size does. * fix(core): check the number rules before sizing a Query key value Query sized an N value in a key condition by its digit string, so an invalid number got the key size sentence. The service checks the number first. Measured 2026-11-20 in us-east-1 on a GSI with HASH n (N), each shape twice: - 2049 or 39 digits answer "Attempting to store more than 38 significant digits in a Number", in KeyConditionExpression and in KeyConditions. - 1 followed by 2100 zeros answers "Number overflow. Attempting to store a number with magnitude larger than supported range". - The service serves 2100 zeros followed by 1. validate_query_key_sizes now passes each N value it reads to validate_and_normalize_number and sizes the normalized digits. Query served a 39-digit value before and refuses it now, as the service does. The doc comment of validate_query_key_sizes no longer lists two shapes as not measured. The wire tests assert both, a HASH sum of exactly 2048 bytes and the aggregated hash sentence over an oversized RANGE value. Both pass against the service. The comment also names a request that ExtendDB serves and the service refuses. The request has an undefined #name in a second clause, on a key schema with one HASH attribute and at most one RANGE attribute. * fix(query): check Select against the GSI projection after the key size With no ExclusiveStartKey, Query checked Select=ALL_ATTRIBUTES against the index projection before the other request checks. The service makes that check after the key size check. With a start key, it also comes after the start key checks. Measured 2026-11-20 in us-east-1 on a KEYS_ONLY GSI with Select=ALL_ATTRIBUTES, each shape twice: - A 2049-byte key value answers the size sentence, with and without an ExclusiveStartKey. - A 1-byte value answers the Select sentence. - Without a start key, Limit 0 and a parameter mix each answer their own refusal ahead of the Select sentence. So do an empty or invalid KeyConditionExpression, a missed key schema element, a wrong-typed key value and a filter or projection fault. ProjectionExpression with ALL_ATTRIBUTES and an unused name or value also come first. ExtendDB answered the Select sentence for all of them. The check now runs once, after the size and start key checks. The comment above the size check no longer says that the type check is still to come. The type check runs above it, in resolve_key_schema_with. The engine test comments cite the measurement dates and region, not local files. * test(query): add the number and Select rows and keep refusal rows visible - test_query_key_size_values.py: rows on a GSI with HASH n (N) for 2049 digits, 39 digits, 1 followed by 2100 zeros and 2100 zeros followed by 1. Each row runs in KeyConditionExpression and in KeyConditions. - test_query_key_size_order.py: rows on a KEYS_ONLY GSI for Select=ALL_ATTRIBUTES with a 2049-byte and a 1-byte value, with and without an ExclusiveStartKey. The Limit 0 row uses the raw_client fixture from conftest.py in place of its own copy. - This commit removes require_multi_range. Neither of its skips fires on any backend at this head. On a refusal row, a 500 or a classifier change turned the row into a skip. - The BETWEEN row is two tests. The refusal half reports its result on MongoDB and Cassandra, where the accept half skips. - The docstrings cite the measurement dates and region, not local files. * docs(core): cite ExtendDB#1214 for the undefined name that Query serves The doc comment of validate_query_key_sizes names one request that ExtendDB serves and the service refuses: an undefined #name in a second key condition clause. ExtendDB#1214 tracks that request. * docs(query): split the long sentences in four new comments Four new comments now use shorter sentences. They are the number rules in sized_clause and its unit test, the undefined #name in validate_query_key_sizes and the Select check in handle_query. They state the same measurements. * fix(core): size a Query key number the validator does not read by its text 001fe29 sized each N value of a key condition after validate_and_normalize_number, so a number written in other Unicode decimal digits got a 400. DynamoDB reads U+FF11 and U+0967 U+0968 as digits. It serves `n = :v` and the KeyConditions form with those values (200, Count 0, measured 2026-11-20 in us-east-1, twice each), and so did the previous head. The size check now calls normalize_number and refuses only the digit count and magnitude faults. A value the validator does not read as a number is sized by its text again, as before 001fe29. The unit table and TestNumberKeyValues gain the two values, in both syntaxes. The Select test uses the shared refused helper. Its 1-byte row without a start key goes, because test_query_start_key_partition.py sends the same request. Two comments are shorter. * fix(core): do not size a Query key N value that is not a number 31159a2 sized an N value that normalize_number does not read as a number by its text. So 2049 `x` or 2049 U+FF11 in a key condition got the hash size sentence. DynamoDB refuses such a value with a number sentence before it looks up the table (measured 2026-11-24 in us-east-1, twice each). 2049 `x` gets `The parameter cannot be converted to a numeric value: ` and the value, in KeyConditionExpression and in KeyConditions. 39 U+FF11 get `Attempting to store more than 38 significant digits in a Number`. Such a value now adds nothing to the size, and ExtendDB serves the Query as main does. The number check of key condition values is ExtendDB#544's. The unit table gains a 2049 `x` row and a 2049 U+FF11 row. * test(query): fold the key size rows into two tables query_key_size_tests.rs had 19 tests that sent rows of the core tests through the expression parser. The wire files send the same rows end to end. The file keeps the two tests that add a path: the clause order in the expression, and the KeyConditions desugaring. The comments of two deleted index tests named a gate that b116a46 took out. In the core tests, one table holds the equality rows on the base table, on `idx` and on `two-hash`. A second table holds the six undefined-reference rows. Each row keeps its measurement comment. Two rows have measurements from 2026-11-20 on `two-hash`, and their comments no longer say "Not measured". They are a HASH sum of exactly 2048 bytes, and the aggregated hash sentence with a 1025-byte RANGE value. Two tests checked the end of a sentence that a table row asserts in full, and they are gone. * fix(core): count each key attribute once in the Query key size The size check added every clause into the HASH or RANGE total, including a second clause on one key attribute. `pk = :a AND pk = :b` with 1025 bytes in each value got the aggregated hash sentence. `pk = :p AND sk = :a AND sk = :b` with 600 bytes in each got the range sentence. Main serves both. DynamoDB refuses both with `Invalid KeyConditionExpression: KeyConditionExpressions must only contain one condition per key`. The `pk` shape is from a measurement on 2026-11-24 in us-east-1 (sent twice), and ExtendDB#489 records the `sk` shape. Each key attribute now contributes its largest value once, and the single hash check reads that value. The one-condition-per-key refusal is ExtendDB#484's. Two rows join the equality table. * style(core): clear the clippy warnings in the Query key size code The pedantic clippy run flagged `ExtendDB` without backticks in the doc comment of validate_query_key_sizes (doc_markdown). The two tables of 762d4a8 tripped type_complexity, a default lint that CI's `-D warnings` refuses. Each table now names its row type. After this commit, clippy with `-W clippy::pedantic` and `--all-targets` on extenddb-core and extenddb-engine reports no warning on a line this PR adds. * test(query): rename the isrefused tests and reuse assert_validation Nine test names in test_query_key_size.py read `isrefused`, and they now read `is_refused`. `refused` in query_key_size_support.py repeated the three asserts of helpers.assert_validation. It now calls that helper and takes its `code` argument. In test_query_key_size_order.py, `_first` and five tests made the same three asserts after `_error`, and they now call `refused`. `_error` stays for the two syntax error tests, which check the start of the message. * docs(query): count one sort key value per attribute in the limits table 482bf8a counts the largest value of each key attribute once. The sort key row of docs/dynamodb-limits.md said that the Query check adds up every sort key clause. It now says that the check adds up the sort key values of the key condition, one per attribute. * fix(core): refuse a Query key N value that is not a number a3f733d sized an N value that normalize_number does not read as a number as 0 bytes, so the Query went on to storage. On SQLite at 1e5f4bc, `abc`, 2049 `x`, `" 1"` and the empty value answered HTTP 200 with Count 0. That was the answer on a GSI keyed on an N attribute, in KeyConditions and on the base table's N partition key. On the base table's N sort key they answered InternalServerError, and the server log shows `invalid numeric sort key: invalid digit found in string`. DynamoDB refuses each of these values with `The parameter cannot be converted to a numeric value: ` followed by the value as sent. The empty value gets the colon too (measured 2026-11-24 in us-east-1, twice each, in KeyConditionExpression and in KeyConditions). sized_clause now refuses such a value with that text when the value holds ASCII characters only. NumberFault::Empty has no colon, so the refusal uses the text of NumberFault::Malformed. A value with a character outside ASCII still adds nothing to the size. The service reads Unicode decimal digits as digits, and the number rules do not (ExtendDB#565). A refusal here would refuse one U+FF11, which the service reads as the number 1. The unit table now expects the sentence for 2049 `x`. It gains rows for `abc`, `" 1"`, the empty value, and `1e-131` as a partition key value and as a sort key value. * test(query): pin the number sentences in each Query key position test_query_key_size_values.py gains a table for N values that the service refuses as numbers: `abc`, 2049 `x`, `" 1"`, the empty value and `1e-131`. Each row runs in four forms. Two are on a GSI keyed on an N attribute, in KeyConditionExpression and in KeyConditions. The other two use the N partition key and the N sort key of a new `number_table` fixture. Each row asserts status, code and message by equality. The service gives these answers before the table lookup (measured 2026-11-24 in us-east-1, twice each, on a table that does not exist). Two more rows, 39 and 683 U+FF11, assert the service's 38-digit sentence. They are expected failures on ExtendDB, because the number rules do not read U+FF11 as a digit (ExtendDB#565). The mark is not strict, so a check that reads these digits makes the rows of its form pass. The existing number test now builds its Query with the same helper. On a server built from 1e5f4bc, the 16 rows for `abc`, 2049 `x`, `" 1"` and the empty value fail. 12 of them get HTTP 200, and the 4 on the sort key get InternalServerError. The 4 underflow rows pass there too. With 1fe3f0c, the three wire files pass on SQLite: 99 passed and 8 expected failures. * test(query): leave the U+FF11 rows to ExtendDB#565 The files in tests/python hold no expected failures (tests/python/README.md, Design Principles). The rows for 39 and 683 U+FF11 assert the service's 38-digit sentence. ExtendDB gives that sentence only once its number rules read Unicode decimal digits, which is ExtendDB#565, so the rows and their mark go. The measurements of 2026-11-24 are on ExtendDB#565. * test(query): pin the Select order on a KEYS_ONLY GSI without a start key On a KEYS_ONLY GSI with Select ALL_ATTRIBUTES and no ExclusiveStartKey, DynamoDB answers each of these refusals before the Select sentence: - Limit 0 - a key condition on the base table's partition key - an N value on the S key - an unused expression value - an empty KeyConditionExpression - FilterExpression `#` A reviewer measured each shape twice on 2026-11-24. These shapes are now rows of test_select_all_attributes_on_a_keys_only_gsi_is_reported_after. Each row asserts status, code and message by equality, except the `#` row. ExtendDB words that syntax error in its own way (ExtendDB#1419), so the row checks the `Invalid FilterExpression: ` label. The table now sends its requests through raw_client, because the SDK refuses Limit 0. FILTER_LABEL, LIMIT_MESSAGE and MISSED_G_MESSAGE hold the three texts that a new row shares with an existing test. With the Select check moved above the Limit check, the six new rows fail. The two 2049-byte rows of the table and two start key rows in test_query_start_key_partition.py fail too. On SQLite, the three wire files and test_query_start_key_partition.py give 136 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes since the last review
crates/engine/src/lib.rs(module lines) anddocs/differences-from-dynamodb.md(new rows). fix(scan): drop the FilterExpression suffix from the values message #765 also passes no expression parameters to the Scan values check, a file this branch leaves alone. On the merged tree,cargo fmt --checkis clean, andcargo clippy --all-targets -- -D warningsis clean onextenddb-coreandextenddb-engine. The core lib tests give 1146 passed and 1 ignored, and the engine lib tests give 927 passed and 1 failed. The failed test,backup::tests::a_healthy_store_makes_create_backup_store_backed, is outside this branch and passed in 5 of 5 runs after that.The review of 24 November read d7e6ff3. This round adds 0e0f078 and 35910e9, and 4b5125a merges main at 44cd436. Main's four new commits change none of this branch's files. The bullets from 5cd089d to d7e6ff3 are the round before.
crates/engine/src/lib.rs, where main adds a module line.NOT_A_NUMBER,EMPTY_ATTRIBUTE_VALUEandMULTI_ATTRIBUTE_VALUEfrom core in place of three private copies inquery_key_values.rs. Core now makes the three public. The texts do not change.first_faultreads the members of anM.TestShapeFaultsAreReportedFirst.Querysection todocs/differences-from-dynamodb.md, with rows for Query on a table ARN in another account answers AccessDeniedException ahead of the request checks #974, Unicode decimal digits in N values: refused on writes, compared as text on reads #565 and Query beside a Limit above 2147483647 answers the number fault without the wrapper the service adds #976.shape_fault_firstnow deserializes each member of the body on its own, and eachExpressionAttributeValuesvalue on its own. Before, it deserialized the whole body once and stopped at the first member that failed. SoSelect: 5beside an emptyNSandLimit: 0answered theLimittext, where the service answersSerializationException. The commit also stops counting two kinds of member as shape faults. One is a string inConsistentReadorScanIndexForwardthat the service reads as a boolean, such as"true","T"or"0". The other is a number inLimit. Beside an invalidSelect, e2d90f1 answeredSerializationExceptionfor each, where the service and main answer theSelecttext.ScanIndexForward: nullbesideSelect: "NOPE", andExpressionAttributeNames: {"#a": null}beside an invalidSelectorReturnConsumedCapacity, answeredSerializationExceptionat d7e6ff3, where the service and main answer the enum text. The service reads a null member as an absent one and a null name as an empty name, which it reports after these checks.shape_fault_firstnow skips a null member and readsExpressionAttributeNameswithout its null names. The handler's deserializer still refuses both (see Differences that remain).{"SS": ["a", "a"], "N": "1"}answered the more than one datatypes text, where the service answersInput collection [a, a] contains duplicates.for the value.first_faultnow reads these set faults on that path,SSahead of the numbers andNSafter its own numbers, as measured. TheSSandBStexts come from theAttributeValuedeserializer. TheNStext and its check move from core'spartiqlmodule tovalidation::number, so a build without thepartiqlfeature has them.dynamodb:LeadingKeyssentence now describe main as it is. "Differences that remain" names the issue for each difference and adds nine more. The merge checks are new, for main at 1d3be63. "Testing done" has the requests measured on 2026-11-23.What
This branch adds two checks to the expression path of
Query, incrates/engine/src/query_key_values.rs.An
Nvalue inExpressionAttributeValuesthat is not a number answersThe parameter cannot be converted to a numeric value: <value>. In the overflow, underflow and 38-digit cases, it answers the text for that case. An empty value answers the message with the colon and nothing after it. The answer has noExpressionAttributeValues contains invalid valuewrapper. OnQuerythe service adds that wrapper in two cases. One is a value it cannot read as one type (see below). The other is aLimitabove 2147483647 (see Differences that remain).The check covers the whole map, including
NSmembers and values nested inLandM, whether the key condition, theFilterExpressionor nothing reads them. The check reads each entry on its own, so a value that does not deserialize does not stop the check of another. The walk covers the same values thatPutItemandUpdateItemcheck.The check accepts a Unicode decimal digit below U+10000 as the ASCII digit of the same value, as the service does. These digits are the 37 runs of ten general category
Nddigits up to U+FF10 in Unicode 15.0, among them ASCII, fullwidth, Arabic-Indic and Devanagari. Incrates/engine/src/decimal_digits.rs, the check folds each such digit to ASCII before the number rules run, with a binary search over the 37 run zeros. The check refuses a digit of the 31 runs from U+104A0 up, as the service does. Its refusal echoes the value with each decimal digit folded to ASCII. The fold applies to the check only. The handler and the server's key binding read the value as written (see Differences that remain). The fold adds no new dependency and does not change the write paths.The check runs at request time on the raw body, before ExtendDB deserializes it and before the table lookup. It runs in the service's order:
Limit, theReturnConsumedCapacityenum, the expression and non-expression parameter mix,ExpressionAttributeNames, the numbers, then theSelectenum. This movesLimitahead of the two enum checks and the table lookup. It also moves the mix check ahead of the table lookup and theSelectcheck, and theSelectcheck after the numbers. Because the checks read the raw body, a field that does not deserialize does not stop the ones before it.A value in
ExpressionAttributeValuesthat the service cannot read as one type takes the service's own order. Such a value is a null, or holds no known type descriptor, more than one, or an unknown one beside a known one. A known type descriptor with a null payload counts as absent. A value that anLorMholds counts too. An invalidSelect, an invalidReturnConsumedCapacityand aLimitbelow 1 come first, together in one message, with theLimittext that names the value (Value '0' at 'limit'for 0). The parameter mix comes next, then theExpressionAttributeNameskey checks (an invalid key, a key over 255 bytes, an empty map). Then the first value with a fault answersExpressionAttributeValues contains invalid value: <reason> for key <placeholder>, with a number echoed as written. Beside a second type descriptor, an empty set and a set with a duplicate member are faults of the value too.SScomes ahead of the numbers, so{"SS": ["a", "a"], "N": "bob"}answersOne or more parameter values were invalid: Input collection [a, a] contains duplicates.for the value.NScomes after theNand its own numbers, and ahead ofBSandL, so{"NS": ["1", "1"], "N": "bob"}answers the numeric text and{"NS": ["1", "1"], "L": [{"N": "bob"}]}answersInput collection contains duplicates. The answer names a value the service cannot read ahead of a number fault in another value. An empty name inExpressionAttributeNamescomes after the values. This code is incrates/engine/src/query_key_values/unreadable.rs.When a check fails, ExtendDB deserializes each member of the body, and each
ExpressionAttributeValuesvalue, on its own as part of the typed input. If the deserializer raises aSerializationExceptionfor a member of the wrong JSON type, ExtendDB returns it instead, which is the service's order. A fault in one member or value does not hide a shape fault in another. BesideLimit: 0, for example,Select: 5next to an emptyNSanswersSerializationException, as on the service. So does{"S": 5}after an emptyNSin another value. In anExpressionAttributeValuesvalue the service cannot read as one type, ExtendDB first replaces the parts the service cannot read. So a field of the wrong JSON type in the rest of the value still answersSerializationException. The service also reads a null inExclusiveStartKey, and an unknown type descriptor there or in aKeyConditionsAttributeValueList, as a value it cannot read as one type. ExtendDB looks for such values only inExpressionAttributeValues(see Differences that remain). For a value with one type descriptor, aValidationExceptionthe deserializer raises (an empty set, a duplicate, an invalidAttributeValue) does not preempt the check. Those orders are not measured (Query reports an invalid Select ahead of an empty set, a duplicate set member or a NULL of false #979). Neither does anAttributeValuewith an unknown type descriptor.The service reads a string such as
"true","T"or"0"inConsistentReadorScanIndexForwardas a boolean, and any number inLimitas an integer. It reads a null member as an absent one, and a null name inExpressionAttributeNamesas an empty name, which it reports after these checks. So ExtendDB does not count these members as shape faults. Any other string in those two members, such as"on", is a shape fault, as on the service. When a body passes every check, the handler deserializes it once. The handler still refuses every string in those two members, a null member or name, and aLimitsuch as1.5or1e2(see Differences that remain).The server runs the same request-time checks ahead of the IAM decision, because authorization binds no
dynamodb:LeadingKeysvalue to a number it cannot parse. On main, a principal whose Allow carriesForAllValues:StringEquals dynamodb:LeadingKeys ["alice"]passes the IAM decision forpk = :uwith:u = {"N": "bob"}, since no key is bound. The engine then refuses the request with theCondition parameter type does not match schema typetext of item 2, and it serves no partition. A principal under aForAnyValue,Nullor plain-operator fence answersAccessDeniedExceptionon main, where the request's error is the numericValidationException. Incrates/server/src/request_helpers.rsthe call sits between the tag ARN shape check andvalidate_operation_arns, after the cross-account refusal. The dev-mode return comes after these checks, so theQuerychecks also run in dev mode.A key condition value whose type is not the key attribute's type answers
One or more parameter values were invalid: Condition parameter type does not match schema type. The check covers the partition key value and the sort key value under=,<,<=,>,>=and the reversed operand order. It also covers bothBETWEENbounds, thebegins_withprefix, and the extra conditions of a multi-attribute index key. The check reads the queried table's or index's key schema. So it checks a GSI partition or range key and an LSI range key against their own definitions.On a single-attribute key schema with a
KeyConditionExpression, the check runs after the key schema,FilterExpression,ProjectionExpression, unused value andSelectchecks and before theExclusiveStartKeycheck. When a compared placeholder is undefined, the check returns without a verdict and ExtendDB reports the undefined placeholder, which is the service's order. On a multi-attribute key schema and for legacyKeyConditions, the key schema classifier checks the type first, as on main. Both places call the classifier'scheck_key_value_type.refuse_begins_with_on_number, from fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429, refusedbegins_withby the sort key's type. It now refuses by the type of the value, as the service does. An N or BOOL value answersInvalid KeyConditionExpression: Incorrect operand type for operator or function; operator or function: begins_with, operand type: N(orBOOL) on an S, N or B sort key. An S or B value on a sort key of another type answers the schema type message.The legacy
KeyConditionschecks are not changed here. They land with #507, and #975 tracks their order against the other checks.Scanis not changed here (see Differences that remain).The number check runs ahead of the
FilterExpressionplaceholder check. So theQueryrow of #1211 (:n = {"N": "abc"}beside an undefined placeholder in the filter) gets the service's answer,The parameter cannot be converted to a numeric value: abc(SQLite server built from 5cd089d, 2026-11-23).Refs #1211
The checks take
NOT_A_NUMBER,EMPTY_ATTRIBUTE_VALUEandMULTI_ATTRIBUTE_VALUEfrom core, which makes them public. They also takeNUMBER_SET_DUPLICATESandhas_equal_numbers, which move from core'spartiqlmodule tovalidation::numberso that every build has them. Thepartiqlmodule reads them from there. The pieces below repeat code that exists elsewhere, each for the reason given:first_faultandmake_readablewalk the rawAttributeValueJSON, beside the PartiQL walker (check_valueandmodelled_valueincrates/core/src/partiql/params.rs). Their rules differ. TheQuerywalker reads the numbers and the sets in every payload before it answers the more than one datatypes text. The PartiQL walker answers that text first. Core also compiles the PartiQL walker only with itspartiqlfeature.NULL_VALUEandTYPE_DESCRIPTORSrepeat two private constants of the same PartiQL module, for the same reason. The engine builds without thepartiqlfeature.set_faultbuilds a one-descriptor value and reads theSSorBSrefusal from theAttributeValuedeserializer, so the duplicate and empty set texts have one copy.enum_violationinunreadable.rsbuilds the enum clause thatvalidate_enum_fieldsbuilds. Beside a value the service cannot read as one type, the enum clauses and theLimitclause go into one message, andvalidate_enum_fieldsreturns a finished message.Value '<n>' at 'limit'text has five copies on main, inscan.rs,list_tables.rsandbackup.rs. One helper for all of them would change three handlers that this branch does not touch.Why
On main, a
Querywith aKeyConditionExpressionrefuses a key condition value of another type, a check from #429. It answersOne or more parameter values were invalid: Condition parameter type does not match schema type(the schema type message), and it serves no partition forpk = :uwith:u = {"N": "bob"}or{"N": "5"}on an S key. Main still answers differently from the service in the cases below, which this branch changes. The main answers come from the three test files below, run on 2026-11-24 against a SQLite server built from main at 44cd436. There, 150 of the 329 tests pass and 179 fail.Nvalue inExpressionAttributeValuesis a number. For{"N": "bob"}as the key value on an S key, main answers the schema type message, where the service answersThe parameter cannot be converted to a numeric value: bob. On a missing table, main answersResourceNotFoundException. With{"N": "bob"}only in the filter, the request succeeds on main. Thirty nine Devanagari ones as a sort key value answerInternalServerErroron main, where the service answers the 38-digit message.Limitand parameter mix checks after the table lookup, soLimit: 0on a missing table answersResourceNotFoundException. An invalidSelectbeside{"N": "bob"}answers theSelecttext, where the service answers the numeric text.FilterExpression,ProjectionExpression, unused value andSelectchecks. The service checks the type after them. For example,sk = :swith:s = {"N": "5"}and no partition key condition answers the schema type message on main andQuery condition missed key schema element: pkon the service.begins_withby the sort key's type. The service refuses it by the type of the value.ConsistentRead: 1beside an invalidSelectanswers theSelecttext on main. BesideLimit: 0,Select: 5next to an emptyNSanswersOne or more parameter values were invalid: An number set may not be empty. The service answersSerializationExceptionfor both.{"X": "1"}main answersSerializationException(Start of structure or map found where not expected: unknown AttributeValue type descriptor: X), and the service answersExpressionAttributeValues contains invalid value: Supplied AttributeValue is empty, must contain exactly one of the supported datatypes for key :z. For a set with a duplicate member beside anSor anN, such as{"SS": ["a", "a"], "N": "1"}, main answersSupplied AttributeValue has more than one datatypes set, must contain exactly one of the supported datatypes, and the service answersExpressionAttributeValues contains invalid value: One or more parameter values were invalid: Input collection [a, a] contains duplicates. for key :z(Query: a value with two type descriptors and a duplicate set member answers another text than DynamoDB #1186).dynamodb:LeadingKeysfence then getsAccessDeniedExceptionor the schema type message, where the request's error is the numericValidationException(see What).Refs #1186
#1381 (mine) is the change for #1186 in core's
AttributeValuedeserializer, which reads the values of every request. This PR'sfirst_faultreads Query values ahead of that deserializer, so it needs the same order here. The second of the two to merge drops the copy. On top of #1381,first_faultcan take the deserializer's text for a value with two type descriptors, as the body of #1381 says. The two branches merge with no conflict.Differences that remain
A
Querythat names a table ARN in another account answersAccessDeniedExceptionahead of the request-time checks, as everyQuerycheck does on main. With such a table ARN, the service answersThe parameter cannot be converted to a numeric value: bobfor{"N": "bob"}, and theLimittext forLimit: 0. Query on a table ARN in another account answers AccessDeniedException ahead of the request checks #974 covers this.For a legacy
KeyConditionsvalue of the wrong type on a single-attribute key schema, the service reports theProjectionExpression,Select,FilterExpression,QueryFilterand unused value checks first. For example,KeyConditions {"pk": EQ [{"N": "5"}]}besideSelect: SPECIFIC_ATTRIBUTESwith no projection answers1 validation error detected: Must specify the AttributesToGet or ProjectionExpression when choosing to get SPECIFIC_ATTRIBUTES. Beside aQueryFilterEQ with an emptyAttributeValueList, it answersOne or more parameter values were invalid: Invalid number of argument(s) for the EQ ComparisonOperator. ExtendDB answers the schema type message for both, as main does. On a multi-attribute key schema the service reports theSelect, projection and unused value checks ahead of the type as well. Query reports a wrong-typed legacy or multi-attribute key value ahead of the projection, filter, unused value and Select checks #975 covers both.On
Query,Limit: 2147483648beside{"N": "bob"}answersExpressionAttributeValues contains invalid value: The parameter cannot be converted to a numeric value: bob for key :u, andLimit: 2147483647beside it answers the bare text. ExtendDB answers the bare text for both. Query beside a Limit above 2147483647 answers the number fault without the wrapper the service adds #976 covers this.When two or more
Nvalues are invalid, the service's choice among them is not fixed. Six identical requests with:a,:band:cinvalid namedaaa,bbb,aaa,bbb,cccandccc. ExtendDB reports the first in sorted placeholder order.pk > :uwith:u = {"N": "5"}on an S key: the service answers the schema type message. ExtendDB's parser refuses the shape (partition key condition must use equality (=)) before the key schema is known, as on main. fix(query): refuse a key condition with no HASH equality the way the service does #479 and fix(auth): bind LeadingKeys for a refused Query's partition operand #511 own that shape.The service checks the
BETWEENbounds order and one condition per key in aKeyConditionExpressionbefore the schema type. Main does not make those checks on the expression path. TheBETWEENcase answersCount: 0, and the case with two conditions on one key also answersCount: 0. So a request that carries both faults answers the schema type message here. Before fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429, thebegins_withcase answeredInternalServerError. This branch now checks thebegins_withoperand type (see What). fix(core): refuse a second condition on a key in KeyConditionExpression #484 adds the one-condition-per-key check. The service'sInvalid KeyConditionExpression:prefix on the undefined placeholder message and its empty key value message (The AttributeValue for a key attribute cannot contain an empty string value. Key: pk) are also absent on main and unchanged here.Scanon the service applies the same numeric check to itsExpressionAttributeValues(top-level and nested, overflow, 39 digits, empty with the colon) before the table lookup. The service reportsLimit0 first. Main'sScandoes not apply the check, and itsLimit0 message readsValue '0' at 'limit'where the service's readsValue at 'Limit'. This branch does not changeScan.On SQLite, main and this branch apply
other = :sinpk = :u AND other = :s(a non-reserved name outside the key schema) to the sort key column. Query on a single-attribute key schema applies a condition on a non-key attribute to the sort key #674 covers this.The service reads a Unicode decimal digit (
{"N": "5"}) as a number when it compares, and stores the ASCII value. Here the number check accepts it. Everything after the check reads the value as the request wrote it, as on main. So a key condition or filter written with a Unicode digit matches no item stored with the ASCII digit. A numeric sort key orExclusiveStartKeywritten that way answersInternalServerErroron SQLite and PostgreSQL.The write paths (
PutItem,UpdateItem, the batch and transaction writes) refuse such a value on main and are not changed here. Reading the digit as a number has to change the server'sdynamodb:LeadingKeysbinding and the engine together. Unicode decimal digits in N values: refused on writes, compared as text on reads #565 covers that change. A principal under adynamodb:LeadingKeysfence sending such a key value binds no number at the server. The engine then matches nothing, which a test pins. The service's answer for a fenced principal is not measured (this host has no restricted principal).The service also reads a null in
ExclusiveStartKey, and an unknown type descriptor there or in aKeyConditionsAttributeValueList, as a value it cannot read as one type. BesideLimit: 0, it answers1 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 1for each of the three (measured 2026-11-23). This branch answers theValue at 'Limit'text for{"X": "1"}, where main answersSerializationException. Both answerSerializationExceptionfor the null. Query words a Limit below 1 differently from the service beside an unknown descriptor in ExclusiveStartKey or KeyConditions #981 covers this.A set with a duplicate member in a value with one type descriptor, alone or inside an
LorM. The request-time checks leave it to the deserializer, which refuses it after theSelectcheck. So beside an invalidSelectthis branch answers theSelecttext, where the service names the duplicate. Query reports an invalid Select ahead of an empty set, a duplicate set member or a NULL of false #979 covers this. The service's answer for the nested shape is not measured.A value with an
Sand anNwhose exponent is outside the int32 range: the service andfirst_faultanswer different texts. For{"S": "x", "N": "1e9999999999"}the service answers the numeric text, andfirst_faultanswers the overflow text. Query: an N with an exponent outside int32 beside a second type descriptor answers the range text, where DynamoDB answers the number text #1187 covers this.A type descriptor with a null payload beside another one, such as
{"S": null, "N": "1"}: the service reads the value as the other type and serves the request. The request-time checks pass it, and the handler's deserializer then refuses it withSupplied AttributeValue has more than one datatypes set, must contain exactly one of the supported datatypes, as on main. The fix has to change the deserializer and the server'sextract_typed_valuein one step, so it stays with A value with a null payload beside another type descriptor is read as that type by DynamoDB and refused by ExtendDB #1188.A null member, and a null name in
ExpressionAttributeNames. The service readsScanIndexForward: nullas an absent member: alone, with aTableNamethat does not exist, it answersResourceNotFoundException(measured 2026-11-24). It reads{"#a": null}as an empty name and reports it after theSelectand number checks. Alone, it answersExpressionAttributeNames contains invalid value: Empty attribute name for key #a. Beside{"N": "bob"}it answers the numeric text in theExpressionAttributeValues contains invalid value: ... for key :nform. The request-time checks here pass both nulls, so beside an invalid enum this branch answers the enum text, as the service does. Beside{"N": "bob"}it answers the bare numeric text. When every check passes, the handler's deserializer refuses both withSerializationException(invalid type: null, expected a booleanorexpected a string), as on main. A JSON null in a key, an ExpressionAttributeValues entry, an AttributesToGet element or a batch or transaction item answers SerializationException, where DynamoDB answers ValidationException #1102 covers the null members.{"S": "a", "X": "1"}: the service reads it as the S valuea, and with aTableNamethat does not exist it answersResourceNotFoundException(measured 2026-11-23). The request-time checks pass it, and the deserializer refuses it with the more than one datatypes text. ExtendDB refuses an AttributeValue with an unknown descriptor beside a known one, which the service reads as the known one #980 covers this.A shape fault such as
ExpressionAttributeNames{"#k": 5}, or an undefined placeholder, still answersAccessDeniedExceptionto a principal the policy does not allow, where the service answers the fault. Only theLimit, enum, parameter mix,ExpressionAttributeNamesand number checks run ahead of the IAM decision. Query: a principal the policy does not allow gets AccessDeniedException for a request with a fault, where DynamoDB answers the fault #1191 covers this.Limit: 0.0answersSerializationException: Start of structure or map found where not expected: invalid type: floating point `0.0`, expected i64on main and here. The service answers1 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 1(measured 2026-11-23). Beside an invalidSelect, this branch answers theSelecttext, as main does. The service truncates a fraction toward zero before it checks the value, soLimit: 0.5beside{"N": "bob"}answersValue '0' at 'limit'there, where this branch answers the numeric text. Query: an empty AttributesToGet, a fractional Limit, a value nested 32 levels deep and a malformed number in ExclusiveStartKey answer differently from the service #720 covers this, and fix(scan): report every Limit, Segment and TotalSegments range fault in the service's two forms #850, which builds on this branch, reads a floatLimitfrom its digits.A string in
ConsistentReadorScanIndexForwardthat the service reads as a boolean. With aTableNamethat does not exist,{"ConsistentRead": "yes"}answersResourceNotFoundExceptionon the service (measured 2026-11-23). The request-time checks here pass such a string, so beside an invalidSelectthis branch answers theSelecttext, as the service does. When every check passes, the handler's deserializer refuses the string withSerializationException(invalid type: string "yes", expected a boolean), as on main. BesideLimit: 0, the service answers1 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 1. This branch answers theValue at 'Limit'text there, and main answersSerializationException. A boolean member given as a JSON string is read differently from the service #984 covers this.Limit: 0beside aTableNamethat does not match[a-zA-Z0-9_.-]+answers thetableNamepattern text on main and here. The service answers theValue at 'Limit'text. Beside{"N": "bob"}, the service and this branch both answer thetableNametext (measured 2026-11-23). Query and Scan: a TableName outside the pattern beside Limit 0 answers the table name, where DynamoDB answers the Limit fault #905 covers this.Merge checks
On 2026-11-23 I ran
git merge-tree --write-treeof this branch at d7e6ff3 against main at 1d3be63. I also ran it against the current heads of the open PRs that change the same files. This branch merges clean with main. Each PR below merges clean with main on its own unless its line says otherwise, so these conflicts come from this branch. On 2026-11-24 I ran the same check at 35910e9 against main at 44cd436, which is clean. I also ran it against the three PRs that build on this branch. The two new commits changequery_key_values.rs,unreadable.rs,number.rsandparams.rs. Those PRs change the same files, so each of them gets conflicts when it merges this branch:fix(scan): check the numbers in ExpressionAttributeValues as the service does #562 gets one hunk in
crates/engine/src/query_key_values.rs: its widerLimit,SegmentandTotalSegmentsarm sits where this branch adds theExpressionAttributeNamesarm. Keep both.fix(scan): report every Limit, Segment and TotalSegments range fault in the service's two forms #850 gets one hunk in
crates/core/src/validation/number.rs, five inquery_key_values.rsand two inunreadable.rs. Innumber.rs, both branches addNUMBER_SET_DUPLICATESandhas_equal_numberswith different doc comments.params.rsmerges clean because both make the same change there. fix(scan): report every Limit, Segment and TotalSegments range fault in the service's two forms #850 movesfirst_faulttovalue_fault.rswith asetsflag of the same shape. Its merge carries over theTYPE_DESCRIPTORSorder withSSfirst. It also runs the set checks for a value with two type descriptors in its first pass over the values.fix(scan): check AttributesToGet, ScanFilter, ExclusiveStartKey and ExpressionAttributeValues in the service's order #854 gets seven hunks in
query_key_values.rsand two inunreadable.rs, inshape_fault_firstandfirst_fault, which it also rewrites.fix(core): refuse a second condition on a key in KeyConditionExpression #484, fix(query): refuse a key condition with no HASH equality the way the service does #479, fix(expressions): validate in the service's order, with its messages #399, fix(engine): send the ConditionalOperator enum text alone on Query and Scan #1100 and fix(engine): answer a missing TableName, Key or Item as DynamoDB does #1262 conflict in
crates/engine/src/query.rs.fix(query): check legacy conditions against the key schema #507 conflicts in
crates/engine/src/query.rs.fix(query): refuse key condition values over the key size limits #481 conflicts in
crates/engine/src/lib.rsandcrates/engine/src/query.rs. Inlib.rs, both branches add a module line at the same place, so keep both. Inquery.rs, keep this branch's side of theLimithunk, because theLimitcheck moved tovalidate_query_request_body. Both branches insert a check before theExclusiveStartKeycheck, and fix(query): refuse key condition values over the key size limits #481's comment places the type check above its key size check. So keep this branch's block first and fix(query): refuse key condition values over the key size limits #481's after it.fix(expression): operator cap, syntax error wording, PutItem map keys #558 and fix(mongodb): evaluate deeply nested conditions instead of answering 500 #571 conflict in
crates/core/src/expression/key_condition.rs, where this branch changes a doc comment.fix(core): report the first ProjectionExpression fault in written order #1140 and fix(core): refuse a document path of more than 32 elements #597 conflict in
crates/engine/src/query.rs. On their own, they also conflict with main incrates/core/src/expression/parser.rsandcrates/core/src/expression/update_parser.rs.Commit 4a4e92f (
fix(cassandra): pass the bare index name in IndexNotFound so the Query sentence matches the other backends) is in this branch, but main got the same change from #483. So the diff has nostorage-cassandrahunk, and the squash message should omit that commit.Testing done
Measured on the service
The requests went to us-east-1 from an admin principal, with client retries off. Each request went twice. The tables had these keys:
pkS andskS (with an LSI and a GSI),pkS andskN (with a GSI), andbpkB andbskB. Later requests also used a table withpkS andskS and one whose GSI has HASHh1(S) andh2(N) and RANGEr(S).2026-10-24 15:10 UTC, the reported shapes:
pk = :u,:u = {"N": "bob"}ValidationExceptionThe parameter cannot be converted to a numeric value: bobpk = :u,:u = {"N": "5"}ValidationExceptionOne or more parameter values were invalid: Condition parameter type does not match schema typepk = :u,:ua B valuepk = :u,:u = {"BOOL": true}pk = :u AND sk = :s,:s = {"N": "5"}pk = :u AND pk > :v,:u = {"N": "bob"},:v = {"S": "alice"}The parameter cannot be converted to a numeric value: bobpk = :u AND pk > :v,:u = {"N": "5"},:v = {"S": "alice"}Invalid KeyConditionExpression: KeyConditionExpressions must only contain one condition per key2026-10-24 21:00 UTC, 77 requests, where the two checks fall against the other
Querychecks:IndexName, an undefined placeholder, an unused value and a syntax error. It reports the message ahead ofConsistentReadon a GSI, a nested key path, a non-equality partition operator and an invalidExclusiveStartKeyas well. The message also comes ahead of theSelectandProjectionExpressionchecks and a reserved word in the filter. The service answers the numeric message for anNvalue that only theFilterExpressionreads or that nothing reads. It reportsLimit0 and the expression and non-expression parameter mix ahead of the message. An emptyNanswersThe parameter cannot be converted to a numeric value:,1e200answers the overflow message, and 39 digits answer the 38-digit message.Query condition missed key schema element, a reserved word in the key condition, the unknown index,Limit0 and the unused value. It also reports the message after the undefined placeholder, the missing table,ConsistentReadon a GSI, abegins_withoperand error and a reserved word in the filter. AProjectionExpressionoverlap and theSelectchecks come ahead of it too. The message comes before an invalidExclusiveStartKey. It applies to the partition and the sort key, on the table, a GSI and an LSI, for the six comparison operators,BETWEENandbegins_with. It coversNULL,SS,L,M,BOOLandBvalues on an S key, S and N values on a B key, and S values on an N key.2026-10-24 21:06 UTC, 29 requests:
Nvalue that is not a number insideL,M,NSorMinLinM, read by the filter or by nothing, answers the numeric message.Nanswers the message with the colon.KeyConditions.Limit0 comes ahead of a missing table, an unknown index,ConsistentReadon a GSI, the parameter mix and the numeric check.2026-10-24 23:42 UTC, the request-time order:
Selectbeside{"N": "bob"}answers the numeric message. An invalidReturnConsumedCapacitybeside it answers1 validation error detected: Value 'bad' at 'returnConsumedCapacity' failed to satisfy constraint: Member must satisfy enum value set: [INDEXES, TOTAL, NONE].Limit0 comes ahead of an invalidSelectand an invalidReturnConsumedCapacity, and the parameter mix comes ahead of an invalidSelect.Limit-1 comes ahead of the numeric message.Limit0 comes ahead of a type mismatch and a number that is not a number in one request.2026-10-25 11:31 UTC, Unicode decimal digits, on an S/N table holding an item with
skN1andaN1:a(Count 1). As an unused value, it answers the unused-value text (the digit passed the number check).Attempting to store more than 38 significant digits in a Numberin all three positions.1\uff12and1e\uff12(Count 0).NSpasses the check.PutItemwithskN\uff11, andGetItemby the fullwidth key and by the ASCII key both return the item withskN1. So the service stores the ASCII value.2026-10-25 11:31 UTC, shape faults:
Limit: 0withExpressionAttributeValues: "x"andExpressionAttributeNames: "x"with{"N": "bob"}answerSerializationException: Unexpected field type.Limit: "1"with{"N": "bob"}answersSTRING_VALUE cannot be converted to Integer.AttributesToGet: {"a": 1}withProjectionExpressionanswersStart of structure or map found where not expected.QueryFilter: [1]withFilterExpressionanswersSerializationExceptionwith no message.Select: 5with{"N": "bob"}andLimit: 0withSelect: 5answerNUMBER_VALUE cannot be converted to String.Limit: 0with{"N": "bob"}and no shape fault answers theLimittext.Limit: 0beside{"X": "1"}answers theLimitValidationException(12:56 UTC), in its olderValue '0' at 'limit'form.2026-11-06,
begins_withand the main merge:Invalid KeyConditionExpression: Incorrect operand type for operator or function; operator or function: begins_with, operand type: N(orBOOL), on an S, N or B sort key.ProjectionExpressionoverlap, theSelectcheck and a partition key value of the wrong type.begins_withwith an N value on an attribute outside the key schema answers the same refusal, on a table with an S or N sort key.tests/test_query_key_value_types.pypassed against the service (131 passed and 2 skipped at 19:30 UTC). So on a single-attribute key schema the type comes after the missing-key, filter, projection, unused-value andSelectchecks. fix(query): classify and order key conditions on a multi-attribute GSI the way the service does #429's early check now runs only on a multi-attribute key schema and for legacyKeyConditions. With thebegins_withrows added, the file had 140 passed and 2 skipped against the service.tests/test_dev_mode_authorization.pypassed, and theQueryfile gave the same answers as on a server that is not in dev mode.2026-11-11:
ReturnConsumedCapacitycomes ahead of the parameter mix withAttributesToGet,QueryFilter,ConditionalOperatororKeyConditions, and ahead of anNvalue that is not a number.Ndruns up to U+FF10 as aFilterExpressionvalue. Digit one of each of the 31 runs from U+104A0 up answersThe parameter cannot be converted to a numeric value: <value>.{"N": "\uff11bob"}answersThe parameter cannot be converted to a numeric value: 1bob.:uwith{"N": "bob"}beside:zwith{"X": "1"}names:zin 40 of 40 requests. Twelve other shapes of:zbeside that:uname:ztoo, and five shapes of:abeside it name:a.{"L": [null, "x"]},{"L": [{"X": "1"}, {"N": 5}]}and{"L": [null, {"B": "!!"}]}answerSerializationException, and so does{"S": 5, "X": "1"}withLimit0.2026-11-12, each request twice (the last one six times):
TableNameset to a table ARN in another account,{"N": "bob"}answersThe parameter cannot be converted to a numeric value: bob,Limit: 0answers1 validation error detected: Value at 'Limit' failed to satisfy constraint: Member must have value greater than or equal to 1, and a valid body answersAccessDeniedException: The caller is not authorized to access the specified resource.KeyConditions {"pk": EQ [{"N": "5"}]}on an S key answers the schema type message. BesideSelect: SPECIFIC_ATTRIBUTESwith no projection, besideSelect: ALL_PROJECTED_ATTRIBUTESon the table, and besideQueryFilter {"a": {"ComparisonOperator": "EQ", "AttributeValueList": []}}, it answers theSelecttexts and theQueryFiltertext.Limit: 2147483648beside{"N": "bob"}answers the text with theExpressionAttributeValues contains invalid valuewrapper, andLimit: 2147483647beside it answers the bare text.:a{"N": "aaa"},:b{"N": "bbb"}and:c{"N": "ccc"}namedaaa,bbb,aaa,bbb,cccandccc.2026-11-23, 15 bodies, each request twice with the same answer, with a
TableNamethat does not exist. EachQuerybody without its own key condition haspk = :pand:p = {"S": "x"}. TheSelecttext is1 validation error detected: Value 'NOPE' at 'select' failed to satisfy constraint: Member must satisfy enum value set: [SPECIFIC_ATTRIBUTES, COUNT, ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES].Limit: 0,:u = {"X": "1"},Select: 5,pk = :uSerializationExceptionNUMBER_VALUE cannot be converted to StringLimit: 0,:u = {"X": "1"},pk = :uValidationException1 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 1Limit: 0,:s = {"NS": []},Select: 5SerializationExceptionNUMBER_VALUE cannot be converted to StringLimit: 0,:a = {"NS": []},:b = {"S": 5}SerializationExceptionNUMBER_VALUE cannot be converted to StringConsistentRead: "true",Select: "NOPE"SelecttextConsistentRead: "T",Select: "NOPE"SelecttextConsistentRead: "on",Select: "NOPE"SerializationExceptionUnexpected token received from parserConsistentRead: 1,Select: "NOPE"SerializationExceptionNUMBER_VALUE cannot be converted to BooleanConsistentRead: "yes"ResourceNotFoundExceptionConsistentRead: "true",Limit: 0ValidationException1 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 1ScanIndexForward: "true",Select: "NOPE"SelecttextScanIndexForward: "0",Select: "NOPE"SelecttextLimit: 1.5,Select: "NOPE"SelecttextScan:Limit: 0,:u = {"X": "1"},Select: 5SerializationExceptionNUMBER_VALUE cannot be converted to StringScan:ConsistentRead: "true",Select: "NOPE"Selecttext2026-11-24, 21 bodies, each request twice with the same answer, with a
TableNamethat does not exist. EachQuerybody haspk = :pand:p = {"S": "x"}, orpk = :zfor the:zrows.INVALIDstands forExpressionAttributeValues contains invalid value:,PARAMSforOne or more parameter values were invalid:.ScanIndexForward: null,Select: "NOPE"SelecttextExpressionAttributeNames: {"#a": null},Select: "NOPE"SelecttextExpressionAttributeNames: {"#a": null},ReturnConsumedCapacity: "NOPE"ValidationException1 validation error detected: Value 'NOPE' at 'returnConsumedCapacity' failed to satisfy constraint: Member must satisfy enum value set: [INDEXES, TOTAL, NONE]ExpressionAttributeNames: {"#a": null},:n = {"N": "bob"}INVALIDThe parameter cannot be converted to a numeric value: bob for key :nScanIndexForward: nullResourceNotFoundExceptionExpressionAttributeNames: {"#a": null}ValidationExceptionExpressionAttributeNames contains invalid value: Empty attribute name for key #a:z = {"SS": ["a", "a"], "N": "1"}INVALIDPARAMSInput collection [a, a] contains duplicates. for key :z:z = {"SS": ["a", "a"], "N": "bob"}:z = {"SS": ["a", "a"], "X": "1"}:z = {"SS": ["a", "a"], "L": [null]}:z = {"S": "x", "L": [{"SS": ["a", "a"]}]}:z = {"NS": ["1", "1"], "S": "x"}INVALIDInput collection contains duplicates for key :z:z = {"NS": ["1", "1"], "L": [{"N": "bob"}]}:z = {"NS": ["1", "1"], "BS": ["YQ==", "YQ=="]}:z = {"NS": ["1", "1"], "N": "bob"}INVALIDThe parameter cannot be converted to a numeric value: bob for key :z:z = {"NS": ["bob", "bob"], "S": "x"}:z = {"BS": ["YQ==", "YQ=="], "N": "bob"}:z = {"BS": ["YQ==", "YQ=="], "N": "1"}INVALIDPARAMSInput collection [YQ==, YQ==]of type BS contains duplicates. for key :z:z = {"SS": [], "N": "1"}INVALIDPARAMSAn string set may not be empty for key :z:z = {"NS": [], "S": "x"}INVALIDPARAMSAn number set may not be empty for key :z:z = {"BS": [], "N": "1"}INVALIDPARAMSBinary sets should not be empty for key :zNot measured
Whether the service answers a principal fenced away from the value with
ValidationExceptionorAccessDeniedExceptionfor the schema type case cannot be measured on this host. No restricted principal can be created there. The test file does not encode either answer. The same holds for a fenced principal and a value the service cannot read as one type: the LeadingKeys test pins ExtendDB's answer only. The order ofLimit0 against theSelectALL_ATTRIBUTESindex projection check was not measured. TheLimitcheck now runs first.Tests
crates/engine/src/query_key_values/tests.rs: 19 unit tests at the checks. They cover the six comparison operators and the reversed operand order, bothBETWEENbounds, and S, N and B keys. Other cases are a GSI range key, a multi-attribute hash schema,#namereferences and an undefined placeholder, where the check returns without a verdict. The tests also cover the numeric messages, nestedNS,LandMvalues, values the key condition does not name and sorted order. The rest cover the accepted and refused decimal digits and the folded echo.crates/engine/src/query_key_values/request_order_tests.rs: 5 unit tests for the request-time order (Limit,ReturnConsumedCapacity, the parameter mix, the numbers,Select) and for a shape fault in another field. One of them holds 11 rows of 2026-11-23 and 3 rows of 2026-11-24. They cover a shape fault past a fault in another member or value, andConsistentReadas a number and as"on". They also cover the members that the service reads as a boolean or an integer, a null member and a null name.crates/engine/src/query_key_values/unreadable_tests.rs: 8 unit tests for values the service cannot read as one type. Four cover the named placeholder, the wrapped and echoed numbers, the value named ahead of a number fault and the combined enum andLimitmessage. One covers a number or set fault named ahead of the more than one datatypes text. It has 16 rows of 2026-11-19 and 15 rows of 2026-11-24. One covers a type descriptor with a null payload. Two cover shape faults.crates/engine/src/query_key_values/names_tests.rs: 1 unit test with 28 rows for theExpressionAttributeNameschecks. The rows cover their place after the mix and ahead of the numbers. Beside a value the service cannot read as one type, they cover the key checks ahead of the value and an empty name after it. Other rows send names that no expression reads.crates/engine/src/query_gate_tests.rs: 2 tests throughhandle_query. It refuses a legacyKeyConditionsvalue of another type, and it refuses a multi-attribute value of another type before the non-key rule.crates/engine/src/query_begins_with_tests.rs: 3 unit tests for thebegins_withrefusal by value type.crates/engine/src/decimal_digits.rs: 5 unit tests (the measured digits and controls, the runs from U+104A0 up, the run zeros, folding of text).tests/test_query_key_value_types.py(dual target): 214 tests.ROWSholds 170 parametrized rows, one per measured request whose answer the branch produces. The other 44 tests are controls and Unicode digit tests, among them digit one of each of the 37 runs below U+10000.tests/test_query_value_shapes.py(dual target): 113 tests:TestShapeFaultsAreReportedFirst,TestValuesTheServiceCannotReadAsOneType,TestMembersTheServiceReadsAreNotShapeFaultsandTestExpressionAttributeNamesOrder. The 11 rows of 2026-11-23 are inSHAPE_FAULTS(5 rows) andNO_SHAPE_FAULT(6 rows). On a SQLite server built from e2d90f1, 7 of the 11 fail. The 18 rows of 2026-11-24 are inNO_SHAPE_FAULT(3 rows) andUNREADABLE(15 rows). On a SQLite server built from d7e6ff3, 15 of the 18 fail. The 3 that pass there answer the numeric text and pin what does not change.tests/test_query_leading_keys_values.py(ExtendDB only): 2 tests. UnderForAllValues,ForAnyValue,Null false,StringEquals,StringLikeandStringNotEqualsfences and as the owner,{"N": "bob"}as the key value, beside an invalidSelect, only in the filter, or unused, getsValidationExceptionand no items. A partition key written with Unicode digits returns no item of a partition outside the caller'sForAllValuesfence.Merge of main
4b5125a merges main at 44cd436 with no conflict. Main's four commits change the PostgreSQL backup code, the SQLite management store,
tests/conftest.pyand five test files. This branch changes none of these files. The runs of this round above are on 35910e9, before this merge.5cd089d merges main at 8c64333 with no conflict. On the merged tree, before the other commits of this round,
cargo test -p extenddb-engine --libpassed (913 tests). The three Python files above passed (300 tests) on a SQLite server built from 5cd089d.Gates
At 35910e9, the head:
cargo +1.97.0 fmt --all -- --check: clean.cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine --all-targets -- -D warnings: 0 warnings.cargo +1.97.0 clippy -p extenddb-engine --all-targets --features backup-test-hooks -- -D warnings: 0 warnings.cargo +1.97.0 clippy -p extenddb-server --all-targets -- -D warnings: 0 warnings.cargo +1.97.0 clippy -p extenddb-core --all-targets --no-default-features -- -D warnings: 0 warnings.cargo +1.91.1 check -p extenddb-core -p extenddb-engine --all-targetsandcargo +1.91.1 check -p extenddb-server --all-targets: 0 warnings.cargo +1.97.0 check -p extenddb-engine --no-default-features: 0 warnings.cargo test -p extenddb-engine --lib: 914 passed, 0 failed.cargo test -p extenddb-core --lib: 1146 passed, 0 failed, 1 ignored. The same with--no-default-features: 885 passed, 1 ignored.pytest --collect-onlycollectstests/(6916 tests) andtests/python(672 tests) with no error.At d7e6ff3, the same gates passed with 914 engine tests, 1146 core tests and 311 Python tests. The server clippy run also passed with
--features backup-test-hooks,mongodb-test-hooks.Earlier runs: at bf3f970,
tests/test_query_value_shapes.pypassed against DynamoDB (84 tests) on two runs. At cd7e8e8, the commit before bf3f970, the three files passed on a PostgreSQL server (296). They also passed against DynamoDB on two runs (294 passed, and the 2 ExtendDB-only tests skipped).Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a. There is no wire,
Storagetrait, auth model or on-disk change.Breaking changes
None.
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.