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/", line 1171, in rqlexec
  res = self._cw.execute(rql, kwargs, cachekey)
File "/home/adim/src/fcube/cubicweb/server/", line 443, in execute
  rset = self._execute(self, rql, kwargs, eid_key, build_descr)
File "/home/adim/src/fcube/cubicweb/server/", line 659, in execute
  results = plan.execute()
File "/home/adim/src/fcube/cubicweb/server/", line 172, in execute
  result = step.execute()
File "/home/adim/src/fcube/cubicweb/server/", line 286, in execute
File "/home/adim/src/fcube/cubicweb/server/sources/", line 307, in syntax_tree_search
  sql, query_args = self._rql_sqlgen.generate(union, args, varmap)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 370, in generate
  sql = self.union_sql(union)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 378, in union_sql
  return self.select_sql(union.children[0], needalias)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 454, in select_sql
  sql = self._solutions_sql(select, sols, distinct, needalias or needwrap)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 511, in _solutions_sql
File "<string>", line 1, in <lambda>
File "/home/adim/src/fcube/cubicweb/server/sources/", line 565, in visit_and
  part = c.accept(self)
File "<string>", line 1, in <lambda>
File "/home/adim/src/fcube/cubicweb/server/sources/", line 684, in visit_relation
  sql = self._visit_outer_join_relation(relation, rschema)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 844, in _visit_outer_join_relation
  self.replace_tables_by_outer_join(join, maintable, *toreplace)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 1192, in replace_tables_by_outer_join
  self._update_outer_tables(lefttable, actualtables, tablealias, outerjoin)
File "/home/adim/src/fcube/cubicweb/server/sources/", line 1213, in _update_outer_tables

A corresponding test has been added in unittest_rql2sql

done in3.5.12
load left0.000
closed by<not specified>