BaseXdb / basex

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

XQuery: Bug on contains-token() with token index #2222

Closed Twilight-Shuxin closed 1 year ago

Twilight-Shuxin commented 1 year ago

Description of the Problem

Given this XML document:

<M v="a"/>

and XPath Query

//M/descendant-or-self::M[contains-token(@v, "a")]

after creating token index BaseX returns empty result set.

Expected Behavior

Should return node M as before token index is created.

Steps to Reproduce the Behavior

  1. Create database create database test <M v="a"/>
  2. Create index token create index token
  3. Execute XPath query xquery //M/descendant-or-self::M[contains-token(@v, "a")]

Do you have an idea how to solve the issue?

No response

What is your configuration?

BaseX version: BaseX 10.7 beta latest commit 27725e9 on Windows

ChristianGruen commented 1 year ago

Thanks for the observation. I noticed it also fails with the default attribute index:

//M/descendant-or-self::M[@v = 'a']
ChristianGruen commented 1 year ago

Fixed (for all index types).