Added test for QueryPagination. #6026