fixbug: incorrect result if no aggregate functions, but grouping keys