There's no bug, so I won't go into that. See my explanation above. THis isn't stubborness, but there's nothing we can do. I'll try to explain things below again
The thing is: with each page request, the same query is executed, and then the paging logic selects the page to fetch from that set, this happens inside the DB.
As I have explained above: there's no defined order in which the rows have to be returned, if there are duplicate rows for the sorting. This means that the database will optimize the query so it obeys the rules of the SQL standard and also gives back the rows requested.
If you append an orderby on CompanyId after the two fields, you'll see you'll get proper paging. I didn't check the query on linq to sql, but I think they append the PK to the ordering in paging situations, LLBLGen Pro doesn't do that. I can't explain in another way how linq to sql could have proper paging over a set which has no pre-defined order.
I also found it weird that page 2-10 were the same and after that it was equal... the thing is though that the query is correct, and sadly, the database is also correct in returning the same pages: simply because there's no correct ordering.
For duplicates, I didnt' mean complete duplicate rows
, but duplicates in the fields to order.
If you fetch customers, and you order on Country, and there are more customers with the same country, what is the order in which these customers with the same country are returned? That's undefined. So one time you'll get them in one order, and another time in another order. To get a deterministic ordering, you'll have to specify a sort clause which, across the ordering, has unique values.
If you for example omit the orderby in linq to sql and you use paging, it will tell you it can't proceed. This is why.
So, it's not a matter of bugs or not, it's a matter of what the SQL standard says and what an RDBMS has to do. With these kind of things, the best thing to do is examine the SQL. You'll see that the paging query LLBLGen pro uses is way different than the one Linq to sql uses, as linq to sql can't page over all resultsets.
I tested different sortings in your testcode, and when I formulated a sorting which, across the fields sorted, had unique values (so the sorting was deterministic!), the paging worked ok. If your collegues still think there's a bug in our code, let them define a query which has a deterministic ordering and show that paging fails.