Skip to content

Conversation

@aidanharan
Copy link
Contributor

@aidanharan aidanharan commented Apr 6, 2020

In MSSQL subqueries cannot have ordering unless they include TOP or OFFSET, otherwise a The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified. error is returned.

Note that ordering in subqueries is valid if it includes FOR XML but this use-case is not supported in the adapter.

Before
https://travis-ci.org/github/rails-sqlserver/activerecord-sqlserver-adapter/jobs/670183329?utm_medium=notification&utm_source=github_status

6728 runs, 18634 assertions, 53 failures, 34 errors, 25 skips

After
https://travis-ci.org/github/rails-sqlserver/activerecord-sqlserver-adapter/jobs/671990453?utm_medium=notification&utm_source=github_status

6731 runs, 18699 assertions, 53 failures, 20 errors, 25 skips

@aidanharan aidanharan changed the base branch from master to 6-0-dev April 6, 2020 14:47
@aidanharan aidanharan force-pushed the in-clause-no-ordering branch from a3f4e6b to 2e57fe4 Compare April 7, 2020 09:58
@aidanharan aidanharan force-pushed the in-clause-no-ordering branch from 2e57fe4 to 3d3faf8 Compare April 7, 2020 10:00
@aidanharan aidanharan changed the title Rails 6: In clause no ordering Rails 6: Subqueries cannot include ordering unless TOP/LIMIT also specified Apr 7, 2020
@aidanharan aidanharan marked this pull request as ready for review April 7, 2020 11:00
@wpolicarpo wpolicarpo merged commit 1300331 into rails-sqlserver:6-0-dev Apr 7, 2020
@aidanharan aidanharan mentioned this pull request Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants