-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
[BUG] Map context item (.) bug: effectiveBooleanValue error filtering maps with not() #3873
Comments
I believe this is a duplicate of the issue with not() in a predicate. |
To test this hypothesis:
|
related #2159 |
Here is what I meant
declare variable $local:maps := (
map { "id": 1 },
map { "id": 2, "foo": 3 },
map{ 1: 0 }
);
declare function local:not($a) {
not($a)
};
declare function local:effective-boolean-value() {
$local:maps[local:not(.?id)]
};
local:effective-boolean-value() |
@line-o I think I found the issue where you posted about the
|
Describe the bug
Issue #3240 described and PR #3496 fixed a number of errors thrown in eXist when the context item (.) is a map, array, or function. We've got another one, so far affecting only maps in certain conditions:
When using a predicate to filter sequence of maps, wrapping the filter expression in a function that involves the context item's effective boolean value causes an error to be thrown.
This query should return
bar
, and BaseX and Saxon return the expected result, but eXist throws aneffectiveBooleanValue
error:The error location points to the
not()
function. This suggests that eXist is treating the query as if the context item is the sequence on the left-hand side of the predicate, instead of the item beingExpected behavior
eXist should not throw this incorrect error.
To Reproduce
Building on the tests in https://github.com/eXist-db/exist/pull/3496/files#diff-6f2de4fc23f42984d074ae40eb4f18bb63715b592ad8d08b699010a7ed1e7460:
This returns the following result:
Context (please always complete the following information):
Additional context
conf.xml
? noThe text was updated successfully, but these errors were encountered: