Skip to content

Translation of OFFSET and LIMIT to Slice(..) is formally incorrect #248

Open
@hartig

Description

@hartig

While working on PR #245, I noticed two problems with the translation of OFFSET and LIMIT in Section 18.3.5.5 OFFSET and LIMIT.

  1. For cases in which there is no LIMIT clause, the definition says: "length defaults to (size(M)-start)." While it is not explicitly stated what "size(M)" is supposed to be, I guess it is meant to refer to the number of solution mappings in M, where M is assumed to be a sequence of solution mappings. The problem is that M is not actually such a sequence. Instead, it is simply an expression of the algebraic syntax, as produced by the previous steps of the translation algorithm.
  2. The Slice expression is created directly with start and length values taken from OFFSET and LIMIT, without checking these values. Then, the evaluation of the Slice expression passes these values directly to the Slice algebra operator, which uses them without checking that they are within the bounds of the current solution sequence. What is supposed to happen if they are not?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions