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
Should return empty result set. For node B, //*/has-children() selects the result of I, A, B three nodes. Applying subsequence(s, 3) selects only the last element, and after application of tail function no result should be selected. In terms of number of results returned, the two reverse() operations seems redundant in this case. If deleted BaseX returns the expected results.
Steps to Reproduce the Behavior
Create database create database db <I><A/><B/></I>
Thanks as always! reverse(tail(reverse(...))) is rewritten to a function that will be introduced with XQuery 4.0 – fn:trunk – and the optimization rules of that function contained a bug.
Description of the Problem
Given this XML document:
and XPath Query
BaseX returns one element false.
Expected Behavior
Should return empty result set. For node
B
,//*/has-children()
selects the result ofI, A, B
three nodes. Applying subsequence(s, 3) selects only the last element, and after application of tail function no result should be selected. In terms of number of results returned, the two reverse() operations seems redundant in this case. If deleted BaseX returns the expected results.Steps to Reproduce the Behavior
create database db <I><A/><B/></I>
xquery //B/reverse(tail(reverse(subsequence(//*/has-children(), 3))))
This is a reduced test case from:
create database db <I><A><B><C/></B></A><D/></I>
xquery //D/reverse(tail(reverse(subsequence(./preceding::*/has-children(), 3))))
Do you have an idea how to solve the issue?
No response
What is your configuration?
BaseX version: BaseX 10.7 beta latest commit 564bd39 on Windows
The text was updated successfully, but these errors were encountered: