Skip to content

[Bug] begins_with operand-type check skipped on FilterExpression for empty or non-matching scans #132

@hicksy

Description

@hicksy

Describe the bug

DynamoDB rejects begins_with(path, value) up front when the value isn't a string or binary. ExtendDB only checks this during row evaluation (added in #72, closed #65), so on a Scan or Query that doesn't match any rows, the check never runs and the request succeeds.

When the filter does evaluate against a row, the check fires but reports Invalid ConditionExpression: ... instead of Invalid FilterExpression: ... - the same FilterExpression labelling issue fixed for redundant parentheses in #130 / #131.

PutItem/UpdateItem/DeleteItem always evaluate the expression, so ConditionExpression isn't affected.

To Reproduce

  1. Create an empty table with pk (S).
  2. Scan with FilterExpression begins_with(#a, :n), #a -> pk, :n -> {N:"1"}. Accepted, should be rejected.
  3. Put an item with pk set and re-run. Rejected, but labelled Invalid ConditionExpression: ....

Expected behavior

Both rejected up front with ValidationException. Same message body as #72, with the Invalid FilterExpression: prefix.

Environment

  • ExtendDB version: current main
  • Deployment method: source

Checklist

  • I have searched existing issues for duplicates
  • I have included the ExtendDB version and environment details
  • I can reproduce this on current main

Notes

Happy to tackle this, but the fix cuts across the evaluator and the handlers, so worth a steer on the approach before I open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions