You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
eXide is showing the wrong error when trying to evaluate this query:
xqueryversion"3.1";
declarefunctionlocal:parent-collection($collection-path as xs:string) as xs:string? {
let $parent-collection-path := replace($collection-path, "(/.+)/.*", "$1")
returnif ($parent-collection-path eq $collection-path ornot(starts-with($parent-collection-path, "/db")))
then
()
else
$parent-collection-path
};
declare %private functionlocal:ascend($collection-path as xs:string, $group-name as xs:string, $collection-permission as xs:string) asempty-sequence() {
if (not(starts-with($collection-path, "/db")))
then
()
elselet $_ := sm:add-group-ace(xs:anyURI($collection-path), $group-name, true(), $collection-permission)
returnlocal:ascend(local:parent-collection($collection-path), $group-name, $collection-permission)
};
local:ascend("/db/apps/test-app/test-dir","monex","r-x")
exerr:ERROR The actual return type does not match the sequence type declared in the function's signature: local:ascend(xs:string, xs:string, xs:string) empty-sequence(). Expected cardinality: empty, got 0. [at line 13, column 39, source: String/6893983447689836372]
In function:
local:ascend(xs:string, xs:string, xs:string) [23:1:String/6893983447689836372]
The issue is saying that the return type of local:ascend is wrong, whilst this has nothing to do with the issue at hand
also it is saying: Expected cardinality: empty, got 0. which should be the same!
The first parameter of local:ascend is expecting xs:string whilst local:parent-collection returns xs:string?.
If I change the first parameter of local:ascend from type xs:string to type xs:string?, then the error goes away.
The fix is not related to the error that is shown, therefore I conclude that eXide/eXist-db is showing the wrong error for the actual problem.
eXide is showing the wrong error when trying to evaluate this query:
The issue is saying that the return type of
local:ascend
is wrong, whilst this has nothing to do with the issue at handalso it is saying:
Expected cardinality: empty, got 0.
which should be the same!The first parameter of
local:ascend
is expectingxs:string
whilstlocal:parent-collection
returnsxs:string?
.If I change the first parameter of
local:ascend
from typexs:string
to typexs:string?
, then the error goes away.The fix is not related to the error that is shown, therefore I conclude that eXide/eXist-db is showing the wrong error for the actual problem.
The text was updated successfully, but these errors were encountered: