Skip to content

[BUG] ForClause's PositionalVar returns incorrect value on empty sequence when allowing empty #5235

@adamretter

Description

@adamretter

The following query in eXist-db returns the wrong result:

for $x allowing empty at $y in ("a", "b", "c")[4]
return
  $x || ":" || $y

The result should be :0, but eXist-db returns :1.

Rerence: https://www.w3.org/TR/xquery-31/#id-xquery-for-clause

Tested against eXist-db 7.0.0-SNAPSHOT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugissue confirmed as bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions