-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Server platform cannot apply LIMIT to a UNION query with ORDER BY #2374
Comments
We never actually supported |
Closing as irrelevant as of #3756. All the queries in the description work as expected in |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The cases below were reproduced on Doctrine DBAL 2.5.4 and SQL Server 11.0.2100.60 with the following code:
UNION with sub-queries surrounded by parentheses
Then
TOP
keyword is not added to the query:Which results into SQL error:
UNION without parentheses
Then
TOP
keyword is added to the first sub-query instead of the resulting set.The SQL server still seems to not like the
ORDER BY
in the CTE:UNION with line breaks.
Unlike Handle arbitrary whitespaces when parsing SQL in order to apply
LIMIT
for MS SQL Server #2372 where only an invalid query is produced, in this case PHP goes into infinite loop:UNION as sub-query where ORDER BY is moved to the outer query.
This approach works.
The text was updated successfully, but these errors were encountered: