Please provide support for the partitioning functions (OFFSET/Fetch) of SQL Server 2012.
For the query
you can create a SQL statement like
No idea without acutally getting the code up and running. Did you already try putting a breakpoint in your OffsetFetch and check where the Take-value is set to 0?
The problem is that my TakeResultOperatorHandler is called with another instance of the sqlStatementBuilder as my SkipResultOperatorHandler. That's because the query is splittet into a sub statement.
So the value of the TakeResultOperator can't be put to the SqlOffsetFetchExpression instance created in the SkipResultOperatorHandler. And vice versa.
Found the problem.
in my TakeResultOperatorHandler. This method (of course) creates a sub statement because the sqlStatementBuilder.TopExpression is already set, with an instance of SqlOffsetFetchExpression from SkipResultOperatorHandler.
That's the one. Just to make sure: You found the problem and were able to solve it, right?