Dear BaseX team,
running the following two queries [1,2] (which should be semantically
equivalent to my eyes) I get different results. In particular [2]
sometimes return multiple results or empty sequence which is pretty odd,
isn't it?
I've tried on 8.5.3 and on a recent snapshot labeled 8.5.4 (beta 6e9bf7c).
Regards,
Marco.
[1]
let $domain :=
for $record in (1 to 100)
where $record mod 5 = 0
return $record
let $index := 1 + random:integer(count($domain))
return
$domain[$index]
[2]
let $domain :=
for $record in (1 to 100)
where $record mod 5 = 0
return $record
return
$domain[1 + random:integer(count($domain))]