Eng 6485 fix bug of limit and group by

There is a function from its base class "validateTableOfScalarLongs", which is convenient for all these results checking code.