Eng 6485 fix bug of limit and group by

bad assert.