rql #9996 error with groubpy & orderby [open]

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, ST.name, 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,ST.name\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/repository.py", line 548, in execute
 File "/home/auc/rep/cubicweb/cubicweb/server/querier.py", line 648, in execute
   results = plan.execute()
 File "/home/auc/rep/cubicweb/cubicweb/server/querier.py", line 161, in execute
   result = step.execute()
 File "/home/auc/rep/cubicweb/cubicweb/server/ssplanner.py", line 347, in execute
 File "/home/auc/rep/cubicweb/cubicweb/server/sources/native.py", line 281, in syntax_tree_search
   self.doexec(cursor, sql, args)
 File "/home/auc/rep/cubicweb/cubicweb/server/sources/native.py", 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

notice that in that case, sql want the column used in the order by clause being in the group by clause, and that would change expected query result, so what we could expect is a nicer (and earlier) error message.

should be detected by the rql st checker

was http://www.cubicweb.org/ticket/5009

appeared in<not specified>
done in<not specified>
load left0.200
closed by<not specified>