cubicweb #628798 error during sql generation with groupbys / outerjoins [resolved]

The following rql query

Any A,E,CV,group_concat(TN) GROUPBY A,E,CV WHERE A is Application, A for_person P, P has_studied_in E?, T? tags A, T name TN, A curriculum CV?

leads to

  Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/adim/src/fcube/cubicweb/server/migractions.py", line 1171, in rqlexec
  res = self._cw.execute(rql, kwargs, cachekey)
File "/home/adim/src/fcube/cubicweb/server/session.py", line 443, in execute
  rset = self._execute(self, rql, kwargs, eid_key, build_descr)
File "/home/adim/src/fcube/cubicweb/server/querier.py", line 659, in execute
  results = plan.execute()
File "/home/adim/src/fcube/cubicweb/server/querier.py", line 172, in execute
  result = step.execute()
File "/home/adim/src/fcube/cubicweb/server/ssplanner.py", line 286, in execute
  inputmap)
File "/home/adim/src/fcube/cubicweb/server/sources/native.py", line 307, in syntax_tree_search
  sql, query_args = self._rql_sqlgen.generate(union, args, varmap)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 370, in generate
  sql = self.union_sql(union)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 378, in union_sql
  return self.select_sql(union.children[0], needalias)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 454, in select_sql
  sql = self._solutions_sql(select, sols, distinct, needalias or needwrap)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 511, in _solutions_sql
  self._state.add_restriction(select.where.accept(self))
File "<string>", line 1, in <lambda>
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 565, in visit_and
  part = c.accept(self)
File "<string>", line 1, in <lambda>
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 684, in visit_relation
  sql = self._visit_outer_join_relation(relation, rschema)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 844, in _visit_outer_join_relation
  self.replace_tables_by_outer_join(join, maintable, *toreplace)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 1192, in replace_tables_by_outer_join
  self._update_outer_tables(lefttable, actualtables, tablealias, outerjoin)
File "/home/adim/src/fcube/cubicweb/server/sources/rql2sql.py", line 1213, in _update_outer_tables
  actualtables.remove(oldalias)

A corresponding test has been added in unittest_rql2sql

prioritynormal
typebug
done in3.5.12
load0.200
load left0.000
closed by<not specified>