Skip to content

Coerce calculations test #1229

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

Merged
merged 1 commit into from
Sep 30, 2024
Merged

Coerce calculations test #1229

merged 1 commit into from
Sep 30, 2024

Conversation

aidanharan
Copy link
Contributor

To limit the results in SQL Server we use FETCH NEXT @0 ROWS ONLY instead of LIMIT @0. To use FETCH NEXT an order must be provided.

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/11104499885/job/30848683699

  1) Failure:
CalculationsTest#test_no_order_by_when_counting_all [/usr/local/bundle/bundler/gems/rails-ebd9beebebe9/activerecord/test/cases/calculations_test.rb:315]:
Expected /ORDER BY/ to not match "EXEC sp_executesql N'SELECT COUNT(*) FROM (SELECT 1 AS one FROM [accounts] ORDER BY [accounts].[id] ASC OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY) subquery_for_count', N'@0 int', @0 = 10".

@aidanharan aidanharan marked this pull request as ready for review September 30, 2024 13:30
@aidanharan aidanharan merged commit e3aba95 into main Sep 30, 2024
4 checks passed
@aidanharan aidanharan deleted the coerce-order-count branch September 30, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant