SQLServer2005LimitHandler applies TOP(?) to subselect

Description

The following sql query with a subselect inserts TOP into the subselect instead of the top-level select clause, producing the sql server error "The number of rows provided for a TOP or FETCH clauses row count parameter must be an integer." (because the parameters are in the wrong order).

Simplified test case:

Full sql query passed to SQLServer2005LimitHandler by hibernate:

Environment

None

Assignee

Chris Cranford

Reporter

Clinton Volzke

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure