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

not having issues when used twice in same query #864

Open
mstevan opened this issue Dec 30, 2020 · 1 comment
Open

not having issues when used twice in same query #864

mstevan opened this issue Dec 30, 2020 · 1 comment

Comments

@mstevan
Copy link
Contributor

mstevan commented Dec 30, 2020

@mstevan
test-set: not.xml
test-cases: fn-not-5 to fn-not-16

@team
Not behaves weirdly when having two not calls within same query.
not("true") or not("true") for example works but not("true") eq not("true")

List of operators to test with because it throws exception:
Eq,ne,lt,le,gt,ge,=,!=,<,<=,>,>=

Input:
not("true") eq not("true")

Output:
⚠️ ️There was an error.

Code: [XPST0017] (this code can be looked up in the documentation and specifications).

Location information: file:/Users/mstevan/Documents/:LINE:1:COLUMN:15:

Undefined function call; Entered function name and arity doesn't match a defined function signature: "not" called with 1 parameters.

Expected output:
true

@ghislainfourny
Copy link
Member

ghislainfourny commented Jan 5, 2021

That's because in JSONiq not is a prefix operator, not a function call.

When serializing back from XQuery to JSONiq, extra parentheses should be added:

(not "true") eq (not "true")

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

No branches or pull requests

2 participants