Sorry for not providing one, I thought it was easy to reproduce. Trying the example from the wiki: for $x in 1 to 2 return prof:variables()
Thanks, I can reproduce this now. The reason why the log output has changed is that some new optimizations were added in BaseX. As the variable $x will never be referenced in the subsequent expressions, the query is rewritten to:
for $x in util:replicate("", 2) return prof:variables()
The empty string is just a dummy here (internally, it’s a static object that requires no repeated instantiations of objects that will never be referenced).
I have updated the example in the documentation:
for $x in 1 to 2 return ($x, prof:variables())
Hope this helps, Christian