Skip to content

Condition expressions: three shapes the service refuses or words differently (measured 2026-10-24) #501

In review

Description

@LeeroyHannigan

Summary

Three condition expression shapes the hosted service refuses or words differently from ExtendDB, measured against the hosted service on 2026-10-24 with PutItem (each repeated, identical answers). ExtendDB answers are from the shared expression parser at main 744ea29. None is covered by #489, which collects Query shapes. Table pk S and sk S; every request below carries ExpressionAttributeValues {":v": {"S": "x"}}.

Shapes

Request Service ExtendDB
ConditionExpression of attribute_not_exists(pk) followed by 300 OR #v = :v terms, names {"#v": "v"} ValidationException: Invalid ConditionExpression: The expression contains too many operators; operator count: 599 (301 terms answer operator count: 601; each OR and each = counts as one operator, and the cap is 300) accepted
ConditionExpression attribute_not_exists(pk) OR #vvv... = :v with a placeholder of 256 bytes (# plus 255 v), names mapping it to v ValidationException: ExpressionAttributeNames contains invalid key: The expression attribute map contains a key that is too long; size of key: 256 (257 bytes answers size of key: 257) accepted
ConditionExpression attribute_not_exists(pk) OR #v = = :v, names {"#v": "v"} ValidationException: Invalid ConditionExpression: Syntax error; token: "=", near: "= = :v" ValidationException: Invalid ConditionExpression: expected attribute path or value placeholder

Notes

The operator count the service reports is twice the number of comparisons plus one for this shape, so a cap test needs both the count and the message. The placeholder length bound was measured at 256 bytes only; the edge between 255 and 256 was not bisected, and the service documentation puts the maximum at 255. The syntax error wording applies to every expression parameter: the same parser produces Invalid FilterExpression:, Invalid UpdateExpression: and Invalid KeyConditionExpression: prefixes on the same fault, so one fix covers the prefix family.

Acceptance

  • A PutItem whose condition holds more than 300 operators, counted as the service counts them, is refused with the service's message and count.
  • A placeholder key over the service's length bound in ExpressionAttributeNames is refused with the service's message and the key's byte count.
  • A syntax error at a repeated operator is worded Syntax error; token: "<token>", near: "<window>" as the service words it, with the window the service shows.
  • Each is pinned by a test that compares the message text to the measured one.

Activity

  1. added this to the 1.0 milestone on Oct 27, 2026
  2. added a commit that references this issue on Nov 1, 2026
    597ef70
  3. added
    v1
    on Nov 3, 2026
  4. LeeroyHannigan commented on Nov 17, 2026

    @LeeroyHannigan
    CollaboratorAuthor

    More syntax error texts that differ, measured on Amazon DynamoDB in us-east-1 on 17 Nov 2026. Each request went out twice and got the same answer both times. The table is keyed on pk (S), and :v is {"S": "c"} where a request uses it. The ExtendDB column comes from SQLite at the head of PR #1095 (5ce57ec), which is open. All answers are ValidationException.

    Request DynamoDB ExtendDB at PR #1095
    UpdateItem SET a = :v, 1 validation error detected: Invalid UpdateExpression: Syntax error; token: "<EOF>", near: "," Invalid UpdateExpression: expected attribute name
    TransactWriteItems Update SET a = :v, Invalid UpdateExpression: Syntax error; token: "<EOF>", near: "," Invalid UpdateExpression: expected attribute name
    UpdateItem SET a = $ 1 validation error detected: Invalid UpdateExpression: Syntax error; token: "$", near: "= $" 1 validation error detected: Invalid UpdateExpression: Syntax error; token: "$", near: "$"
    PutItem condition a = $ 1 validation error detected: Invalid ConditionExpression: Syntax error; token: "$", near: "= $" 1 validation error detected: Invalid ConditionExpression: Syntax error; token: "$", near: "a = $"
    DeleteItem condition a = $ the same as PutItem the same as PutItem
    PutItem condition a = :v AND 1 validation error detected: Invalid ConditionExpression: Syntax error; token: "<EOF>", near: "AND" Invalid ConditionExpression: unexpected end of expression
    GetItem ProjectionExpression l[01 ] Invalid ProjectionExpression: Syntax error; token: "1", near: "01 ]" Invalid ProjectionExpression: Syntax error; token: "1", near: "01]", from the code: the tokenizer drops the space

    The near text of DynamoDB is the token before the fault, the fault and the token after it, with the white space of the request. On UpdateItem, PutItem and DeleteItem, DynamoDB puts 1 validation error detected: ahead of each of these texts. On TransactWriteItems it does not. PR #1095 adds that prefix on these three operations to a refused list index and to the tokenizer's own syntax errors. So the $ rows already carry it there.

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

Metadata

Metadata

Labels

v1

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions