BaseXdb / basex

BaseX Main Repository.
http://basex.org
BSD 3-Clause "New" or "Revised" License
695 stars 264 forks source link

XQuery: Bug on node selection with position() #2219

Closed Twilight-Shuxin closed 1 year ago

Twilight-Shuxin commented 1 year ago

Description of the Problem

Given this XML document:

<T/>

and XPath Query

//*[position() < position()]

BaseX returned node T.

Expected Behavior

Should not select node as predicate evaluates to false always.

Steps to Reproduce the Behavior

  1. Create database create database test <T/>
  2. Execute XPath query xquery //*[position() < position()]

Do you have an idea how to solve the issue?

No response

What is your configuration?

BaseX version: BaseX 10.7 beta latest commit 28e2e38 on Windows

ChristianGruen commented 1 year ago

Fixed, and optimized for all 6 operators (=, !=, <=, >=, <, >): EXPR[position() < position()] is rewritten to ().