Details
Description
Steps to REPRODUCE
- Login as Admin
- Edit the Help.Application.Movies class and enable the "Relational Storage" of the Genre (staticList1) property
- Execute this XWQL query:
select doc.fullName from Document as doc, doc.object(Help.Applications.Movies.Code.MoviesClass) as obj where doc.fullName not like '%Template' and 'drama' member of obj.staticList1
You can either generate it with the Query Generator extension or by editing a page and adding this velocity code:
{{velocity}} $services.query.hql("select doc.fullName from Document as doc, doc.object(Help.Applications.Movies.Code.MoviesClass) as obj where doc.fullName not like '%Template' and 'drama' member of obj.staticList1").execute() {{/velocity}}
Expected results
Only one result is being returned like this:
Actual results
Two results:
Analysis
Happen since the fix for XWIKI-15250.
The previous XWQL query is translated to this HQL query:
select doc.fullName from com.xpn.xwiki.doc.XWikiDocument as doc , com.xpn.xwiki.objects.BaseObject as obj , com.xpn.xwiki.objects.DBStringListProperty as obj_staticList11 join obj_staticList11.list obj_staticList11list where ( doc.fullName not like '%Template' and 'drama' in elements( obj_staticList11.list ) ) and doc.fullName=obj.name and obj.className='Help.Applications.Movies.Code.MoviesClass' and obj_staticList11.id.id=obj.id and obj_staticList11.id.name='staticList1'
The issue comes from the
'drama' in elements( obj_staticList11.list )
which generates (in SQL) another 'join' of the 'obj_staticList11.list'. It should be replaced by:
'drama' in (obj_staticList11list)
or
obj_staticList11list = 'drama'
Attachments
Issue Links
- is related to
-
XWIKI-15250 XWQL group by not working on multiselect lists
- Closed