cubicweb #5773364 rql2sql crash in _visit_outer_join_relation [in-progress]

we don't seem to like this rql query:

Any P WHERE A? require_permission X, P is Personne, P inline2 A

The crash seems related to the outer join and the fact that "P inline2 A" is selected as "principal" relation for "A".

File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 739, in generate
  sql = self.union_sql(union)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 747, in union_sql
  return self.select_sql(union.children[0], needalias)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 841, in select_sql
  needalias or needwrap)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 917, in _solutions_sql
  self._state.add_restriction(select.where.accept(self))
File "/home/jcr/src/cw/rql/rql/utils.py", line 169, in accept
  return visit_method(self, *args, **kwargs)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 968, in visit_and
  part = c.accept(self)
File "/home/jcr/src/cw/rql/rql/utils.py", line 169, in accept
  return visit_method(self, *args, **kwargs)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 968, in visit_and
  part = c.accept(self)
File "/home/jcr/src/cw/rql/rql/utils.py", line 169, in accept
  return visit_method(self, *args, **kwargs)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 1064, in visit_relation
  sql = self._visit_outer_join_relation(relation, rschema)
File "/home/jcr/src/cw/cubicweb/server/sources/rql2sql.py", line 1221, in _visit_outer_join_relation
  leftalias, rightvar.stinfo['principal']._q_sqltable,

AttributeError: _q_sqltable
prioritynormal
typebug
done in<not specified>
closed by<not specified>
patch[test] add failing rql2sql test [in-progress]