cubicweb #1659395 inconsistent rset with missing relation [resolved]

>>> rql('Any R,P WHERE R is Revision, R eid %(e)s, R parent_revision P', {'e': 47272})
<resultset 'Any R,P WHERE R is Revision, R eid %(e)s, R parent_revision P' (1 rows): [47272, 47263] (('Revision', 'Revision'))>
>>> rql('Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D? parent_revision R', {'e': 47272})
<resultset 'Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D? parent_revision R' (1 rows): [None, 47263, None] (('Revision', 'Revision', 'Revision'))>
>>>

In debug mode:

>>> rql('Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R', {'e': 135247})
********************************************************************************
querier input Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R {'e': 135247}
rql for system source: Any %(e)s,P,D WHERE %(e)s parent_revision P, D parent_revision %(e)s
  args {'e': 135247}
  cache key (u'Any %(e)s,P,D WHERE %(e)s parent_revision P, D parent_revision %(e)s', 'Revision')
  solutions [{'P': 'Revision', 'D': 'Revision'}]
exec SELECT %(e)s, rel_parent_revision0.eid_to, rel_parent_revision1.eid_from
FROM parent_revision_relation AS rel_parent_revision0, parent_revision_relation AS rel_parent_revision1
WHERE rel_parent_revision0.eid_from=%(e)s AND rel_parent_revision1.eid_to=%(e)s {'e': 135247} <connection object at 0x36828c0; dsn: 'host=crater2  dbname=jujdocaster  user=juj password=xxx', closed: 0>
--> [[135247, 135235, 135259]]
<resultset 'Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R' (1 rows): [135247, 135235, 135259] (('Revision', 'Revision', 'Revision'))>

>>> rql('Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R', {'e': 135244})
********************************************************************************
querier input Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R {'e': 135244}
rql for system source: Any %(e)s,P,D WHERE %(e)s parent_revision P, D parent_revision %(e)s
  args {'e': 135244}
  cache key (u'Any %(e)s,P,D WHERE %(e)s parent_revision P, D parent_revision %(e)s', 'Revision')
  solutions [{'P': 'Revision', 'D': 'Revision'}]
exec SELECT %(e)s, rel_parent_revision0.eid_to, rel_parent_revision1.eid_from
FROM parent_revision_relation AS rel_parent_revision0, parent_revision_relation AS rel_parent_revision1
WHERE rel_parent_revision0.eid_from=%(e)s AND rel_parent_revision1.eid_to=%(e)s {'e': 135244} <connection object at 0x36828c0; dsn: 'host=crater2  dbname=jujdocaster  user=juj password=xxx', closed: 0>
--> []
<empty resultset for 'Any R,P,D WHERE R is Revision, R eid %(e)s, R parent_revision P, D parent_revision R'>
prioritynormal
typebug
done in3.12.10
load left0.000
closed by#5ad3154a8810 [rql2sql] fix bug avoiding outer join relation to be used as a variable principal. Closes #1659395