We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
for $i in $data1//item, $j in $data2//item where $i/name = $j/name return $i/name
The results of 'where' clause in FLWOR are different in memory and database.
The results of 'where' clause in FLWOR are the same in memory and database.
xquery version "3.0"; let $col := "/db/apps/test" let $data1 := <data> <item><name>1</name></item> <item><name>2</name></item> </data> let $data2 := <data> <item><name>2</name></item> <item><name>3</name></item> </data> let $test := function ($data1, $data2) { for $i in $data1//item, $j in $data2//item where $i/name = $j/name return $i/name } return ( try { $test($data1, $data2) } catch * { "test1: " || $err:description }, (:in eXist 2.2, 3.6.1, 4.6.1, 4.7.0: OK:) try { xmldb:create-collection("", $col), let $data1 := doc(xmldb:store($col, "data1.xml", $data1)) let $data2 := doc(xmldb:store($col, "data2.xml", $data2)) return $test($data1, $data2) } catch * { "test2: " || $err:description } (:in eXist 2.2: OK:) (:in eXist 3.6.1, 4.6.1, 4.7.0: EXCEPTION: variable '$j' is not set:) )
The text was updated successfully, but these errors were encountered:
yup confirmed, and looks like a bug that has been there for a while, ouch.
tested on 5.0.0-RC8-SNAPSHOT via docker
5.0.0-RC8-SNAPSHOT
Sorry, something went wrong.
I would also see this as a bug. It can be worked around with:
let $j := $data2//item return for $i in $data1//item where $i/name = $j/name return $i/name
The equivalent form described in the spec does also fail:
for $i in $data1//item for $j in $data2//item where $i/name = $j/name return $i/name
No branches or pull requests
What is the problem
The results of 'where' clause in FLWOR are different in memory and database.
What did you expect
The results of 'where' clause in FLWOR are the same in memory and database.
Describe how to reproduce or add a test
Context information
The text was updated successfully, but these errors were encountered: