Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
9.7
-
None
-
Unknown
-
Description
- Create a class Main.TestClass with a String property a
- Create a document with 5 object of your class and set the value of the a property in only 2 of the objects, others leave them blank.
- Run the following query and observe the results:
{{velocity}} #set ($limit = 10) #set ($offset = 0) #set ($sqlParams = ["Main.TestClass"]) #set ($query = $services.query.hql(", BaseObject as obj , StringProperty prop where obj.name=doc.fullName and obj.className = ? and obj.id=prop.id.id and prop.name = 'a' order by prop.value asc").addFilter('unique').setLimit($limit).setOffset($offset).bindValues($sqlParams)) query: $query #set ($results = $query.execute()) execute: $results execute.size(): $results.size() count: $query.count() {{/velocity}}
Expected Output:
both execute() and count() should have returned 1, since the unique filter should have done its job in selecting a single distinct document.
Actual Output:
query: org.xwiki.query.internal.ScriptQuery@66578d32 execute: [Main.TestObj.WebHome, Main.TestObj.WebHome, Main.TestObj.WebHome] execute.size(): 3 count: 1
Attachments
Issue Links
- blocks
-
XWIKI-15596 Wiki index shows double entries or performs erratic when descriptors use aliases
- Closed
- relates to
-
XWIKI-16011 Possible missing and duplicated wikis in the wiki index
- Closed