SQLServer2005LimitHandler uncapable of handle subquery in column list

Description

Hi guys,

I just stumbled across the default SQLServer2005LimitHandler which is the default limit handler for SQL server. We have queries with a subquery in the column list like this one:

When the limit handler trys to get the position of the FROM-clause (in method fillAliasInSelectClause) it uses a regular expression:

to determine the actual column aliases in the select. This will match the first FROM-clause in the subquery thus yielding to a wrong select list of the limit clause like this for the example above:

Environment

None

Status

Assignee

Chris Cranford

Reporter

Sebastian Götz

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure