cubicweb #5675737 wrong RQL → SQL translation for reflexive relations [open]

My schema defines something like:

class parent_location(RelationType):
    subject = 'Location'
    object = 'Location'

I used the following RQL query to get all locations that are parent locations of themselves:

Any X WHERE X parent_location X

But it actually returns all locations because the generated SQL seems a bit too much… optimized:

SELECT rel_parent_location0.eid_to
FROM parent_location_relation AS rel_parent_location0
done in<not specified>
closed by<not specified>