Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

And expressions evaluated in reverse order #1

Closed
mosheduminer opened this issue May 3, 2020 · 1 comment
Closed

And expressions evaluated in reverse order #1

mosheduminer opened this issue May 3, 2020 · 1 comment

Comments

@mosheduminer
Copy link
Member

When querying the following JSON (using the sirix rest-api):

[{"key": "hey"}, {"key": 0}]

with the following query:

for $i in bit:array-values(.)
where $i=>key instance of xs:integer and $i=>key eq 0
return $i

I get the following error:

Cannot compare 'xs:string' with 'xs:integer'

However, the AndExpr should short-circuit after evaluating key to not be an instance of xs:integer, rather than throwing an error.

It should be noted that the following query:

for $i in bit:array-values(.)
where $i=>key eq 0 and $i=>key instance of xs:integer
return $i

returns:

{'key': 0}

so it appears that the order of the AndExpr is being reversed.

@JohannesLichtenberger
Copy link
Member

Fixed :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants