cubicweb #5009 error with groubpy & orderby [rejected]

While trying to make one rql query work ('Any VF,S,MAX(REV) GROUPBY VF,S ORDERBY VCD DESC %s WHERE ...') I got this :

CRITICAL: sql: 'SELECT _TREVVCVCDVF0.C0,, MAX(_TREVVCVCDVF0.C1)\nFROM DocumentType AS DT, State AS ST, _TREVVCVCDVF0, document_type_relation AS
rel_document_type0, in_state_relation AS rel_in_state1\nWHERE  rel_document_type0.eid_from=_TREVVCVCDVF0.C0 AND _TREVVCVCDVF0.C0=rel_document_type0.eid_from AND rel_document_type0.eid_to=DT.eid AND DT.type=%(dtt)s AND rel_in_state1.eid_from=_TREVVCVCDVF0.C2 AND rel_in_state1.eid_to=ST.eid\nGROUP BY _TREVVCVCDVF0.C0,\nORDER BY _TREVVCVCDVF0.C3 DESC\nLIMIT 5'
args: {'dtt': 'A'}
dbms message: 'column "_trevvcvcdvf0.c3" must appear in the GROUP BY clause or be used in an aggregate function\n'
2009-01-19 17:13:40 - (cubicweb.sources.system) CRITICAL: sql: 'DROP TABLE _TREVVCVCDVF0'
args: None
dbms message: 'current transaction is aborted, commands ignored until end of transaction block\n'
2009-01-19 17:13:40 - (cubicweb.repository) ERROR: unexpected error
Traceback (most recent call last):
 File "/home/auc/rep/cubicweb/cubicweb/server/", line 548, in execute
 File "/home/auc/rep/cubicweb/cubicweb/server/", line 648, in execute
   results = plan.execute()
 File "/home/auc/rep/cubicweb/cubicweb/server/", line 161, in execute
   result = step.execute()
 File "/home/auc/rep/cubicweb/cubicweb/server/", line 347, in execute
 File "/home/auc/rep/cubicweb/cubicweb/server/sources/", line 281, in syntax_tree_search
   self.doexec(cursor, sql, args)
 File "/home/auc/rep/cubicweb/cubicweb/server/sources/", line 414, in doexec
   cursor.execute(str(query), args)
ProgrammingError: column "_trevvcvcdvf0.c3" must appear in the GROUP BY clause or be used in an aggregate function
done in3.4.5
load left0.000
closed by<not specified>