BaseXdb / basex

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

XQuery: Unexpected exception of arithemetic operations with positional expression #2224

Closed Twilight-Shuxin closed 1 year ago

Twilight-Shuxin commented 1 year ago

Description of the Problem

Given this XML document:

<X/>

and XPath Query

//X[not(position() * 2 = last())]

BaseX gives unexpected exception

[XPTY0004] Cannot convert xs:decimal to xs:integer: 0.5.

Result is similar for query

//X[not(position() + position() = last())]

Expected Behavior

Should be able to execute successfully.

Steps to Reproduce the Behavior

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

Do you have an idea how to solve the issue?

No response

What is your configuration?

BaseX version: BaseX 10.7 beta latest commit abf2eca on Windows

ChristianGruen commented 1 year ago

We keep you busy… Thanks as usual!

Twilight-Shuxin commented 1 year ago

Thanks a lot as well!